예제 #1
0
    // Use this for initialization
    void Start()
    {
        m_cLoadNode = new C_LOADNODE();
        m_cLoadNode.load();
        m_arNodeColor = new int[4];
        m_goNode      = null;

        m_goTower      = new GameObject();
        m_goTower.name = "TowerHolder";

        for (int i = 0; i < 4; i++)
        {
            if (i < 2)
            {
                m_arNodeColor[i] = colorChangeInt(m_cLoadNode.getImpossibleNode(i).GetComponent <Renderer>().sharedMaterial.color);
            }
            else
            {
                m_arNodeColor[i] = colorChangeInt(m_cLoadNode.getPossibleNode(i - 2).GetComponent <Renderer>().sharedMaterial.color);
            }
        }

        m_nNodeIndex       = 0;
        m_nBackgroundColor = 827160832;
        m_cTowerSelect     = gameObject.GetComponent <MapEdit.C_TOWERSELECT>();

        m_cDefenceMap = new C_CUSTOMDEFENCEMAP();
        m_cDefenceMap.init(m_cLoadNode);

        m_bStart        = false;
        m_bRoadBuilding = false;
        m_bFloorEdit    = false;
    }
예제 #2
0
        private void createStage(GameObject goMovingPoint, GameObject goGameTile, GameObject goImGameTile, C_LOADNODE cLoadNode, int nIndex)
        {
            int nWidth  = 12;
            int nHeight = 12;

            m_cLoadNode = new C_LOADNODE();
            m_cLoadNode.load();

            m_cCustomGameMap = new C_CUSTOMGAMEMAP();
            m_cCustomGameMap.init(m_cLoadNode, nIndex);
            m_cCustomGameMap.createMap(nWidth, nHeight);

            m_arMovingPoint          = new GameObject[m_cCustomGameMap.getRoadCol().Count];
            m_arMovingPointTransform = new Transform[m_cCustomGameMap.getRoadCol().Count];

            Vector3 vUp = new Vector3(0.0f, 1.0f, 0.0f);

            for (int i = 0; i < m_cCustomGameMap.getRoadCol().Count; i++)
            {
                m_arMovingPoint[i] = (GameObject)Instantiate(goMovingPoint,
                                                             m_cCustomGameMap.getNode(m_cCustomGameMap.getRoadRow()[i], m_cCustomGameMap.getRoadCol()[i]).transform.position + vUp, Quaternion.identity);
            }


            m_goMovingPointHolder      = new GameObject();
            m_goMovingPointHolder.name = "MovingPoints";
            m_goMovingPointHolder.tag  = "MovingPoints";
            m_goMovingPointHolder.transform.position = new Vector3(11.0f, 0.0f, 11.0f);
            for (int i = 0; i < m_arMovingPoint.Length; i++)
            {
                m_arMovingPoint[i].name             = "MovingPoint" + i;
                m_arMovingPoint[i].transform.parent = m_goMovingPointHolder.transform;
                m_arMovingPointTransform[i]         = m_arMovingPoint[i].transform;
            }
        }
예제 #3
0
    // Use this for initialization
    void Awake()
    {
        m_cLoadAura   = new C_LOADAURA();
        m_cLoadBullet = new C_LOADBULLET();
        m_cLoadEffect = new C_LOADEFFECT();
        m_cLoadItem   = new C_LOADITEM();
        m_cLoadNode   = new C_LOADNODE();


        m_cLoadAura.init();
        m_cLoadBullet.init();
        m_cLoadEffect.init();
        m_cLoadItem.init();
        m_cLoadNode.load();
    }