示例#1
0
    public void changeAlignment()
    {
        alignIndex++;
        if (alignIndex >= 3)
        {
            alignIndex = 0;
        }

        if (alignIndex == 0)
        {
            alignment = ALIGNMENT.ORIGINAL;
        }
        else if (alignIndex == 1)
        {
            alignment = ALIGNMENT.TRANSFORMED;
        }
        else if (alignIndex == 2)
        {
            alignment = ALIGNMENT.DRAWING;
        }
    }
示例#2
0
 private void SetAlignment(ALIGNMENT value)
 {
     alignment = value;
 }
示例#3
0
    DungeonCharacter SpawnCharInMap(Character c, ALIGNMENT a, Tile p)
    {
        GameObject dco = Instantiate(Resources.Load("dungeonEntity"), p.worldPos, Quaternion.identity) as GameObject;
        DungeonCharacter dc = dco.AddComponent("DungeonCharacter") as DungeonCharacter;
        dco.name = c.charName;
        dc.Initialize(c, a, this);
        dc.entity.MoveTo(p);

        triggers.Add(dc);
        stateables.Add(dc);
        stateables.Add(dc.entity);

        return dc;
    }
示例#4
0
    public void Initialize(Character c, ALIGNMENT a, MapState ms)
    {
        character = c;
        mState = ms;
        alignment = a;
        actions = new List<Executable>();
        health = c.maxHealth;
        mana = c.maxMana;
        entity = transform.GetComponent<DungeonEntity>();
        states = new List<CharacterState>();

        GameObject healthBarObj = UnityEngine.Object.Instantiate(Resources.Load("healthbar"), transform.position, Quaternion.identity) as GameObject;
        healthBarObj.transform.parent = transform;
        healthBar = healthBarObj.transform.GetComponent<HealthBar>();
        healthBar.dchar = this;
        healthBar.mState = mState;
    }