Example #1
0
        private void OnCollisionExit2D(Collision2D collision)
        {
            var collisionTag = ObjectService.GetTag(collision);

            if (TagName.PLAYER == collisionTag)
            {
                PropagateAllSaveEvents.EnableSave();
            }
        }
Example #2
0
        private void OnCollisionStay2D(Collision2D collision)
        {
            var collisionTag   = ObjectService.GetTag(collision);
            var playeranimator = collision.gameObject.GetComponent <Player>().Animator;

            var runningAnimation = AnimationService.GetAnimationName(playeranimator) == AnimationName.ACTIVATE ||
                                   AnimationService.GetAnimationName(playeranimator) == AnimationName.COLLECT;

            if (TagName.PLAYER == collisionTag && runningAnimation)
            {
                PropagateAllSaveEvents.DisableSave();
                PropagateTriggerEvents();
                Invoke("SwitchSaveAfterSeconds", 3);
            }
        }
Example #3
0
        private void OnCollisionStay2D(Collision2D collision)
        {
            var collisionTag = ObjectService.GetTag(collision);

            var playerOnSavePosition = TagName.PLAYER == collisionTag && UserIsExecutingSaveAnimation(collision);

            if (playerOnSavePosition && PropagateAllSaveEvents.AllowSave)
            {
                PropagateTriggerEvents();
                PropagateAllSaveEvents.DisableSave();
            }
            else if (TagName.PLAYER == collisionTag && !UserIsExecutingSaveAnimation(collision))
            {
                PropagateAllSaveEvents.EnableSave();
            }
        }
Example #4
0
 private void SwitchSaveAfterSeconds()
 {
     PropagateAllSaveEvents.EnableSave();
 }
Example #5
0
 public override void PropagateTriggerEvents()
 {
     TriggerEventChannels.PropagateMessageEvent(CurrentMessage, MessageTime);
     PropagateAllSaveEvents.Save(SceneManager.GetActiveScene().name);
 }
Example #6
0
 public void SaveTest()
 {
     PropagateAllSaveEvents.EnableSave();
     PropagateTriggerEvents();
 }