2using System.Globalization;
3using System.Runtime.Serialization;
11 internal float holdTime = 2.0f;
12 private float currTime;
33 if (base.isInFieldOfView(cachedGO)) base.actionRecognized =
true;
34 if (!cachedGO || !activated || done)
return;
35 var t = cachedGO.transform;
46 var hands = FindObjectsOfType<HackedHand>();
47 foreach (var hand
in hands) hand.DetachObject(t.gameObject);
59 spentTimeOnAction += Time.deltaTime;
64 chill -= Time.deltaTime;
80 var hands = FindObjectsOfType<HackedHand>();
81 foreach (var hand
in hands) hand.DetachObject(t.gameObject);
94 if (!tcd.IsAttachedToHand())
return;
98 if (tcd.GetHand().currentAttachedObject == cachedGO)
109 currTime -= Time.deltaTime;
120 if (currTime <= 0.0f)
130 objectAction.IfNotTrigger();
156 var ci = CultureInfo.CurrentCulture;
157 var nfi = ci.NumberFormat;
160 var single = Convert.ToSingle(
holdInput.text, ci);
163 holdTime =
float.Parse(value, ci);
167 Debug.LogWarning(
"not parsable number(?) in holdTime inputfield!");
170 holdInput.text = holdTime.ToString(
"F2");
177 base.RefreshTargetDisplay();
179 holdInput.text = holdTime.ToString(
"F2");
184 base.StartPosition();
189 public override void GetObjectData(SerializationInfo info, StreamingContext context)
191 base.GetObjectData(info, context);
192 if (holdTime ==
default || holdTime == 0) holdTime = 2.0f;
193 info.AddValue(
"holdTime", holdTime, typeof(
float));
198 targetPosition = (Vector3) info.GetValue(
"targetPosition", typeof(Vector3));
199 targetRotation = (Vector3) info.GetValue(
"targetRotation", typeof(Vector3));
200 holdTime = info.GetSingle(
"holdTime");
201 foreach (var s
in info)
203 if (s.Name ==
"taktTime")
204 taktTime = (float)info.GetValue(
"taktTime", typeof(
float));
List< GameObject > outPuts
Connection GetConnectionByEndPointId(string id)
ActionObject GetActionByInOut(string id)
static Controller Instance
HoldPositionAction(SerializationInfo info, StreamingContext context)
override void GetObjectData(SerializationInfo info, StreamingContext context)
void onHoldTimeChanged(string value)
new void RefreshTargetDisplay()
static void SetStatic(GameObject go)
bool InGoodRot(Transform t)
GameObject highlightObject
Object highlightCurrentObject
bool InGoodPos(Transform t)
IEnumerator ShowHighLightOriginal()
new void TriggerOutput(string id)
IEnumerator ShowHighLight(ThrowableCanDisable tcd)
void hideHandPreview(GameObject objectToGrab)
static PreviewHand Instance