public Vector2 position; //keep position for when we change scene void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
private void GetDamageFromEnemy(OmniPlayer player, int damage) { player = OmniPlayer.Instance; if (isDefending) { player.currentHP -= (int)(damage * DEFENSE_BUFF_VALUE); isDefending = false; } else { player.currentHP -= damage; } CombatFlow.cl.csm.currentState = CombatStateMachine.BattleStates.PLAYERCHOICE; }