コード例 #1
0
    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);
        }
    }
コード例 #2
0
 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;
 }