public override void OnInspectorGUI() { SensorResponseRouter my = (SensorResponseRouter)target; if (my.anyOfTheseChains.Count == 0) { SensorChain sc = my.GetComponent <SensorChain>(); if (sc != null) { my.anyOfTheseChains.Add(sc); } } if (my.responses.Count == 0) { ResponseChain r = my.GetComponent <ResponseChain>(); if (r != null) { my.responses.Add(r); } } //EditorGUIUtility.LookLikeControls(); DrawDefaultInspector(); }
public override void Fire(SensorResponseRouter r) { SetAll(enableThese, true); SetAll(disableThese, false); foreach (UnityEngine.Object o in toggleThese) { System.Type t = o.GetType(); FieldInfo f = t.GetField("enable"); if (f != null) { f.SetValue(o, !(bool)f.GetValue(o)); break; } PropertyInfo p = t.GetProperty("enable"); if (p != null) { p.SetValue(o, !(bool)p.GetValue(o, null), null); } } }
public void Fire(SensorResponseRouter r) { counter = 0; isRunning = true; responseIndex = 0; lastFiringRouter = r; }
public override void Fire(SensorResponseRouter r) { if (!target || !dataSource) { return; } if (local) { if (position) { target.localPosition = dataSource.localPosition; } if (rotation) { target.localRotation = dataSource.localRotation; } } else { if (position) { target.position = dataSource.position; } if (rotation) { target.rotation = dataSource.rotation; } } //scale is special in unity :S if (scale) { target.localScale = dataSource.localScale; } }
public float hold = 0; //time until we let the next reponse in the chain take over after we fire public abstract void Fire(SensorResponseRouter r);
public override void Fire(SensorResponseRouter r) { Debug.Log(printThis); }
public override void Fire(SensorResponseRouter r) { gameObject.ActivateAll(enableThese); gameObject.DeactivateAll(disableThese); gameObject.ToggleActive(toggleThese); }
public override void Fire(SensorResponseRouter r) { gameObject.SendMessageToAll(sendMsgTo, msg, SendMessageOptions.DontRequireReceiver); }