コード例 #1
0
 // Called when the player is caught.
 private void OnPlayerCaught(WallSegment wall)
 {
     Graffiti.PaintingEnabled = false;
     CancelGameplayTimers();
     GlobalAudioController.TransitionState("Sting");
     GlobalAudioController.Play("VO", bustedVO);
     GlobalAudioController.Play("Stings", bustedSting);
     TimerManager.Schedule(5).OnComplete(() => {
         Manager.SwitchState("Game Over");
     });
 }
コード例 #2
0
        // Activate this officer.
        public void Activate()
        {
            // Play random VO line.
            GlobalAudioController.Play("VO", warningVO.PickRandom());

            // Move up from spawn.
            Vector3 spawnPos  = transform.position;
            Vector3 targetPos = transform.position + Vector3.up * 2;

            TweenManager.Tween(3, 0, "police").OnStep((t) => {
                transform.position = Vector3.Lerp(spawnPos, targetPos, t);
            }).OnComplete(() => {
                active = true;
                TweenManager.Tween(1, 3, "police").OnStep((t) => {
                    transform.position = Vector3.Lerp(targetPos, spawnPos, t);
                }).OnBegin(() => {
                    active = false;
                }).OnComplete(() => {
                    Destroy(gameObject);
                });
            });
        }
コード例 #3
0
 // Initialize this game state.
 public override void OnInitializeState()
 {
     base.OnInitializeState();
     GlobalAudioController.TransitionState("Equal");
 }