Beispiel #1
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;
            }
        }
Beispiel #2
0
    public void release()
    {
        m_cLoadNode = null;

        m_goNode       = null;
        m_cTowerSelect = null;
    }
Beispiel #3
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;
    }
Beispiel #4
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();
    }
Beispiel #5
0
    public void init(C_LOADNODE cLoadNode)
    {
        m_goMarsMapHolder   = new GameObject();
        m_cLoadNode         = cLoadNode;
        m_arDefenceMapIndex = new int[12, 12];
        m_cMapNodeData      = new C_MAPNODEDATA();
        m_cMapNodeData.init();
        m_cMapNodeData.Parse(m_arDefenceMapIndex);
        m_cMapNodeData.release();
        nNodeData = 0;
        m_goMarsMapHolder.name = "MarsMaps";
        m_arMarsMap            = new GameObject[12, 12];

        m_listRoadRow = new List <int>();
        m_listRoadCol = new List <int>();
        m_arNodeColor = new int[4];
    }
Beispiel #6
0
    public void init(C_LOADNODE cLoadNode, int nIndex)
    {
        m_goMarsMapHolder      = new GameObject();
        m_cLoadNode            = cLoadNode;
        m_arDefenceMapIndex    = new int[12, 12];
        m_goMarsMapHolder.name = "MarsMaps";
        m_goMarsMapHolder.transform.position = new Vector3(11.0f, 0.0f, 11.0f);

        m_arMarsMap = new GameObject[12, 12];

        m_listRoadRow       = new List <int>();
        m_listRoadCol       = new List <int>();
        m_arNodeColor       = new int[4];
        m_listTowerSelected = new List <int>();

        setMapData(nIndex);
    }
Beispiel #7
0
 public void init(GameObject goMovingPoint, GameObject goGameTile, GameObject goGameImTile, C_PLAYER cPlayer, C_LOADNODE cLoadNode, int nIndex)
 {
     createStage(goMovingPoint, goGameTile, goGameImTile, cLoadNode, nIndex);
     getWavePoint().AddComponent <C_ENEMYWAVE>();
     getWavePoint().GetComponent <C_ENEMYWAVE>().setPlayer(cPlayer);
     getWavePoint().GetComponent <C_ENEMYWAVE>().setDifficultyHp(PlayerPrefs.GetFloat("CustomGameDifficulty"));
 }
Beispiel #8
0
 public void init(C_LOADNODE cLoadNode)
 {
     m_goMarsMapHolder = new GameObject();
     m_goMarsMapHolder.transform.position = new Vector3(11.0f, 0.0f, 11.0f);
     m_cLoadNode = cLoadNode;
 }
Beispiel #9
0
 public void init(GameObject goMovingPoint, GameObject goGameTile, GameObject goGameImTile, C_PLAYER cPlayer, C_LOADNODE cLoadNode, float fDifficultyHp)
 {
     m_cStage.createStage(goMovingPoint, goGameTile, goGameImTile, cLoadNode);
     m_cStage.getWavePoint().AddComponent <C_ENEMYWAVE>();
     m_cStage.getWavePoint().GetComponent <C_ENEMYWAVE>().setPlayer(cPlayer);
     m_cStage.getWavePoint().GetComponent <C_ENEMYWAVE>().setDifficultyHp(fDifficultyHp);
 }
Beispiel #10
0
    public void createStage(GameObject goMovingPoint, GameObject goGameTile, GameObject goImGameTile, C_LOADNODE cLoadNode)
    {
        C_STAGEMGR.m_eStage = C_STAGEINFO.E_STAGE.E_STAGE0;
        int nWidth  = 12;
        int nHeight = 12;

        m_arMovingPoint          = new GameObject[12];
        m_cDefenceMap            = new C_DEFENCEMAP();
        m_arMovingPointTransform = new Transform[12];

        m_cDefenceMap.init(cLoadNode);
        m_cDefenceMap.createMap(nWidth, nHeight);

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

        m_arMovingPoint[0] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(0, 0).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[1] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(0, 4).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[2] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(nWidth - 1, 4).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[3] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(nWidth - 1, 0).transform.position + vUp, Quaternion.identity);

        m_arMovingPoint[4] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(nWidth - 5, 0).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[5] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(nWidth - 5, nHeight - 1).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[6] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(nWidth - 1, nHeight - 1).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[7] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(nWidth - 1, nHeight - 5).transform.position + vUp, Quaternion.identity);

        m_arMovingPoint[8]  = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(0, nHeight - 5).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[9]  = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(0, nHeight - 1).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[10] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(4, nHeight - 1).transform.position + vUp, Quaternion.identity);
        m_arMovingPoint[11] = (GameObject)Instantiate(goMovingPoint, m_cDefenceMap.getTilePoint(4, 0).transform.position + vUp, Quaternion.identity);



        m_goMovingPointHolder = new GameObject();
        m_goMovingPointHolder.transform.position = new Vector3(11.0f, 0.0f, 11.0f);
        m_goMovingPointHolder.name = "MovingPoints";
        m_goMovingPointHolder.tag  = "MovingPoints";
        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;
        }
    }