예제 #1
0
 public SavedCharacter(int[] tileID, Vector3 position, Quaternion rotation, int currentHealth,
                       int maxHealth, int attackStrength, int defenseStrength, int maxActionPoints, int turnOrderRating, CharacterBehaviourType behaviour)
 {
     this.tileID          = tileID;
     this.position        = position;
     this.rotation        = rotation;
     this.currentHealth   = currentHealth;
     this.maxHealth       = maxHealth;
     this.attackStrength  = attackStrength;
     this.defenseStrength = defenseStrength;
     this.maxActionPoints = maxActionPoints;
     this.turnOrderRating = turnOrderRating;
     this.behaviour       = behaviour;
 }
예제 #2
0
    public void SetBehaviourTo(CharacterBehaviourType type)
    {
        switch (type)
        {
        case CharacterBehaviourType.aggressive:
        {
            if (behaviour == CharacterBehaviourType.passive)
            {
                turnOrderRating = -1;
            }

            characterCanvas.statusAggressive.gameObject.SetActive(true);
            characterCanvas.statusPassive.gameObject.SetActive(false);
            characterCanvas.statusProximity.gameObject.SetActive(false);
            break;
        }

        case CharacterBehaviourType.passive:
        {
            characterCanvas.statusAggressive.gameObject.SetActive(false);
            characterCanvas.statusPassive.gameObject.SetActive(true);
            characterCanvas.statusProximity.gameObject.SetActive(false);
            break;
        }

        case CharacterBehaviourType.proximity:
        {
            characterCanvas.statusAggressive.gameObject.SetActive(false);
            characterCanvas.statusPassive.gameObject.SetActive(false);
            characterCanvas.statusProximity.gameObject.SetActive(true);
            break;
        }
        }

        behaviour = type;
    }