public override void OnEnter() { HeroShelf.Hide(); EnemyShelf.Hide(); TweenCatcher.SetActive(true); Attacker = CombatManager.Instance.Attacker.DiceObject.transform; Defender = CombatManager.Instance.Defender.DiceObject.transform; AttackersRB = Attacker.GetComponent <Rigidbody>(); DefendersRB = Defender.GetComponent <Rigidbody>(); AttackersBC = Attacker.GetComponent <BoxCollider>(); DefendersBC = Defender.GetComponent <BoxCollider>(); AttackersRB.isKinematic = true; DefendersRB.isKinematic = true; AttackersBC.isTrigger = true; DefendersBC.isTrigger = true; AttackersRest = Attacker.GetComponent <CheckForNonCollision>().RestPosition; DefendersRest = Defender.GetComponent <CheckForNonCollision>().RestPosition; if (Attacker.Equals(Defender)) { Attacker.DOMove(SinglePosition.position, .5f).OnComplete(HandleSelfHeal); } else if (CombatManager.Instance.Attacker.UpSide.Ability.TargetType == ETargetType.Enemy) { Attacker.DOMove(AttackerPosition.position, .5f); Defender.DOMove(DefenderPosition.position, .5f).OnComplete(StartAttack); } else { Attacker.DOMove(AttackerPosition.position, .5f); Defender.DOMove(DefenderPosition.position, .5f).OnComplete(StartHeal); } }
private void MoveBack() { Attacker.DOMove(AttackersRest.position, .5f); Defender.DOMove(DefendersRest.position, .5f).OnComplete(MenuManager.Instance.CallGameScreen); }