Exemple #1
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.LogError("TowerBuildMGR 하나 이상 생성 시도 오류");
         return;
     }
     instance = this;
 }
Exemple #2
0
    private void LoadTowerInfo()
    {
        m_builMGR = TowerBuildMGR.instance;

        m_TowerInfoList = CSVFileReader.Read(m_TowerInfoCVSFileName);
        for (int i = 0; i < m_TowerInfoList.Count; i++)
        {
            //DB에서 타워 정보 불러옴
            int nId = (int)m_TowerInfoList[i]["id"];

            TowerBuildPrint TempTowerBuildPrint = new TowerBuildPrint();
            TempTowerBuildPrint.m_nCost             = (int)m_TowerInfoList[i]["Price_lv1"];
            TempTowerBuildPrint.m_nUpgrageCost      = (int)m_TowerInfoList[i]["Price_lv2"];
            TempTowerBuildPrint.m_nSellPrice        = (int)m_TowerInfoList[i]["Price_Sell_lv1"];
            TempTowerBuildPrint.m_nSellUpgradePrice = (int)m_TowerInfoList[i]["Price_Sell_lv2"];

            if (nId == (int)E_TOWERTYPE.E_CANNON)
            {
                m_CannonTower = TempTowerBuildPrint;

                m_CannonTower.m_prefab        = m_Cannonprefab;
                m_CannonTower.m_Upgradeprefab = m_CannonUpgradeprefab;

                m_CannonPriceTxt.text = m_CannonTower.m_nCost.ToString();
            }
            else if (nId == (int)E_TOWERTYPE.E_LASER)
            {
                m_LaserTower = TempTowerBuildPrint;

                m_LaserTower.m_prefab        = m_Laserprefab;
                m_LaserTower.m_Upgradeprefab = m_LaserUpgradeprefab;

                m_LaserPriceTxt.text = m_LaserTower.m_nCost.ToString();
            }
            else if (nId == (int)E_TOWERTYPE.E_MAGIC)
            {
                m_MagicTower = TempTowerBuildPrint;

                m_MagicTower.m_prefab        = m_Magicprefab;
                m_MagicTower.m_Upgradeprefab = m_MagicUpgradeprefab;

                m_MagicPriceTxt.text = m_MagicTower.m_nCost.ToString();
            }
        }
    }
Exemple #3
0
 private void Start()
 {
     m_Rend          = GetComponent <Renderer>();
     m_StartColor    = m_Rend.material.color;
     m_TowerBuildMGR = TowerBuildMGR.instance;
 }