Ejemplo n.º 1
0
    public void ShowSolider()
    {
        for (int a = 0; a < 3; a++)
        {
            CallBullidButtonController(m_SoliderID);
        }
        m_InputControl.CheckTowerList();
        m_activeTowerList.Add(this.gameObject.GetComponent <UnitTower>());
        int index = m_InputControl.m_activeTowerList.Count;

        for (int b = 0; b < 3; b++)
        {
            m_ChangePositionList.Add(m_InputControl.m_activeTowerList[index - 1 - b]);
            Debug.Log(m_ChangePositionList [b].transform.position);
            m_ChangePositionList [b].transform.parent        = m_TowerParent;
            m_ChangePositionList [b].transform.localPosition = m_SetPosition [b];
            m_ChangePositionList [b].gameObject.name         = "Solider" + b.ToString();
            BoxCollider m_BoxCollider = m_ChangePositionList [b].gameObject.GetComponent <BoxCollider> ();
            m_BoxCollider.center = new Vector3(m_ChangePositionList [b].transform.localPosition.x * -2, 0, m_ChangePositionList [b].transform.localPosition.z * -2);
            SoliderController m_SoliderController = m_ChangePositionList [b].gameObject.GetComponent <SoliderController> ();
            m_SoliderController.m_TowerSoliderController = this;
            m_BlackMax += m_SoliderController.m_BlackMax;

            /*這裡是到時空降使用
             * TweenPosition m_TweenPosition = m_ChangePositionList [b].gameObject.GetComponent<TweenPosition>();
             * m_TweenPosition.enabled = true;
             * m_TweenPosition.delay = m_DelayTime;
             * m_TweenPosition.from = new Vector3 (m_SetPosition [b].x, 0, 5);
             * m_TweenPosition.to = m_SetPosition [b];
             * m_TweenPosition.PlayForward ();
             * m_DelayTime += 0.3f;
             * //*/
        }
        m_AllSoliderSample.gameObject.SetActive(false);
        InvokeRepeating("CheckAllSolider", 1, 0.2f);
    }