Exemple #1
0
    // Use this for initialization
    void Start()
    {
        c_playerHealthScript = GetComponent <PlayerHealth> ();
        c_UI            = GameObject.FindGameObjectWithTag("UICanvas").GetComponent <UIControl>();
        c_personalDelay = 30 / c_playerHealthScript.c_playerStats.playerSpeed;
        c_myTurnObject  = new TurnObject(gameObject, c_personalDelay);
        TurnOrder.s_turnOrderList.Add(c_myTurnObject);
        c_myTurnObject.c_myIndex = (TurnOrder.s_turnOrderList.Count - 1);
        if (c_myTurn)
        {
            c_UI.UpdateActiveCharacter(gameObject);
        }
        if (c_enemy != null)
        {
            c_enemyHealthScript = c_enemy.GetComponent <PlayerHealth> ();
        }
        c_playerMove            = GetComponent <PlayerMoveAStar> ();
        c_playerMoveRangeScript = GetComponent <PlayerMoveRangeDijkstra> ();
        c_saveStartPosition     = transform.position;

        c_squaresInMoveRange   = new List <GameObject>();
        c_squaresInAttackRange = new List <GameObject> ();
        c_enemiesInAttackRange = new List <GameObject> ();
        c_attacked             = false;
        c_setupAttack          = false;
        c_resetMove            = false;
        c_currentSkill         = c_characterSkills [0];
        if (!c_myTurn)
        {
            c_particleComponent.Stop();
        }
    }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     c_myTurnObject = new TurnObject(gameObject, c_personalDelay);
     TurnOrder.s_turnOrderList.Add(c_myTurnObject);
     c_myTurnObject.c_myIndex = (TurnOrder.s_turnOrderList.Count - 1);
     c_UI = GameObject.FindGameObjectWithTag("UICanvas").GetComponent <UIControl> ();
 }
Exemple #3
0
    public void SetTurnObject(bool active)
    {
        TurnObject.SetActive(active);

        if (active)
        {
            StartCoroutine(ShowMoveRange());
        }
    }
    private void Start()
    {
        if (icoSphere == null)
        {
            Debug.LogError("icoSphere not set");
        }
        if (activeMaterial == null)
        {
            Debug.LogError("activeMaterial not set");
        }
        standardMaterial  = icoSphere.GetComponent <MeshRenderer>().material;
        turnScript        = icoSphere.GetComponent <TurnObject>();
        standardTurnSpeed = turnScript.turnSpeed;

        soundEffectWhenSet = GetComponent <AudioSource>();
    }
Exemple #5
0
    public static void CallNextTurn()
    {
        TurnObject l_nextTurn    = new TurnObject(null, 0);
        int        l_lowestDelay = int.MaxValue;

        for (int l_count = s_turnOrderList.Count - 1; l_count >= 0; l_count--)
        {
            if (s_turnOrderList [l_count].c_delayValue < l_lowestDelay && s_turnOrderList[l_count].c_character != null)
            {
                l_lowestDelay = s_turnOrderList [l_count].c_delayValue;
                l_nextTurn    = s_turnOrderList[l_count];
            }
        }

        l_nextTurn.c_character.SendMessage("Attack");
    }