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; }
private void OnEnable() { gesture = GetComponent<TransformGesture>(); transformer = GetComponent<Transformer>(); rb = GetComponent<Rigidbody>(); transformer.enabled = false; rb.isKinematic = false; gesture.TransformStarted += transformStartedHandler; gesture.TransformCompleted += transformCompletedHandler; }
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; }