void Start() { tapGesture = GetComponent<TapGesture>(); if (tapGesture != null) { tapGesture.Tapped += (sender, args) => { Debug.Log(transform.name + " tapped"); if (field_wall == null) { AddObjects(CellObjects.WALL); } else { RemoveObjects(CellObjects.WALL); } }; } pressGesture = GetComponent<PressGesture>(); if (pressGesture != null) { pressGesture.Pressed += (sender, args) => { Debug.Log(transform.name + " pressed"); }; } }
protected override void OnUnityStart() { Player.localPosition = Left.localPosition; pressGesture = TapArea.GetComponent<PressGesture>(); pressGesture.Pressed += Tapped; }
protected override void OnUnityStart() { tapGesture = TapObject.GetComponent<TapGesture>(); pressGesture = TapObject.GetComponent<PressGesture>(); tapGesture.StateChanged += TapGestureOnStateChanged; pressGesture.Pressed += PressGestureOnPressed; }
private void OnEnable() { rnd = GetComponent<MeshRenderer>(); longPressGesture = GetComponent<LongPressGesture>(); pressGesture = GetComponent<PressGesture>(); longPressGesture.StateChanged += longPressedHandler; pressGesture.Pressed += pressedHandler; }
protected override void OnUnityStart() { pressGesture = TapArea.GetComponent<PressGesture>(); transformGesture = TapArea.GetComponent<TransformGesture>(); releaseGesture = TapArea.GetComponent<ReleaseGesture>(); pressGesture.Pressed += Pressed; transformGesture.StateChanged += (o, e) => { if (e.State == Gesture.GestureState.Changed) Transformed(); }; releaseGesture.Released += Released; }
public override void OnEnter() { gesture = GestureUtils.GetGesture<PressGesture>(Fsm, GameObject, Component, true); if (gesture == null) { LogError("Gesture is missing"); return; } gesture.Pressed += gesturePressedHandler; }
protected override void OnUnityStart() { transformGesture = TapArea.GetComponent<TransformGesture>(); pressGesture = TapArea.GetComponent<PressGesture>(); releaseGesture = TapArea.GetComponent<ReleaseGesture>(); transformGesture.StateChanged += TransformStateChanged; pressGesture.Pressed += Pressed; releaseGesture.Released += Released; ArmySpawner.AllDestroyed += ArmySpawnerOnAllDestroyed; ArmySpawner.CollidedWithPlayer += ArmySpawnerOnCollidedWithPlayer; }