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

            if (TagName.PLAYER == collisionTag)
            {
                PropagateAllSaveEvents.EnableSave();
            }
        }
示例#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);
            }
        }
示例#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();
            }
        }
示例#4
0
 private void SwitchSaveAfterSeconds()
 {
     PropagateAllSaveEvents.EnableSave();
 }
示例#5
0
 public override void PropagateTriggerEvents()
 {
     TriggerEventChannels.PropagateMessageEvent(CurrentMessage, MessageTime);
     PropagateAllSaveEvents.Save(SceneManager.GetActiveScene().name);
 }
示例#6
0
 public void SaveTest()
 {
     PropagateAllSaveEvents.EnableSave();
     PropagateTriggerEvents();
 }