public override void OnCollisionEnter(GameObject other)
        {
            base.OnCollisionEnter(other);

            if (other is Player)
            {
                var player = (Player)other;

                // Kill the boots and give player run abillity
                player.EnableRunning();

                // Destroy and give seconds.
                done = true;
                TimePiece.SpawnParticles(_timeToGive, collisionBox == null ? transform.position : collisionBox.middle, GameObjectManager.playerInstance);

                // Instantiate Dialogue Box
                var dialogueBox = new DialogueBox(new List <string>()
                {
                    "you've got the running boots! \n\npress [ RT / SHIFT ]\nto activate.",
                    "it will drain your time faster \nthough, so use carefully!"
                });
                dialogueBox.SetEndAction(() => GameObjectManager.ResumeEveryone(null));
                GameObjectManager.AddObject(dialogueBox);

                GameObjectManager.PauseEveryone(new List <GameObject>()
                {
                    dialogueBox
                });
            }
        }
示例#2
0
        public override void Interact()
        {
            base.Interact();

            // Instantiate Dialogue Box
            var dialogueBox = new DialogueBox(_messages);

            dialogueBox.SetEndAction(() => GameObjectManager.ResumeEveryone(null));
            GameObjectManager.AddObject(dialogueBox);

            GameObjectManager.PauseEveryone(new List <GameObject>()
            {
                dialogueBox
            });
        }