Ejemplo n.º 1
0
    public TurretData GetSourceTurretData(Turret turret)
    {
        string key = EnumToStr(turret);

        GameObject source = null;

        if (false == m_sourceTurrets.TryGetValue(key, out source))
        {
            // TEMP
            //Debug.LogError("Finding source by " + key + " failed");
            return(null);
        }

        TurretCtrl ctrl = source.GetComponent <TurretCtrl>();

        return(ctrl.TurretData);
    }
Ejemplo n.º 2
0
    public bool SellTurret()
    {
        TurretCtrl turret = TurretMgr.Inst.FocusedTurret;

        if (turret == null)
        {
            BattleGameObjectMgr.Inst.m_RemoveWarningYet.SetActive(true);
            return(false);
        }

        if (turret.TurretType == Turret.End)
        {
            Debug.LogError("The turretType in turretCtrl is turret.End");
            return(false);
        }

        if (turret.m_maxHP == 0)
        {
            Debug.LogError("The turret maxHP in turretCtrl is zero");
            return(false);
        }

        // 수정

        if (Player.Inst.m_labInfos[7]._lock == true)
        {
            int   turretIdx = (int)turret.TurretType;
            float ratio     = turret.CurHP / (float)turret.m_maxHP;

            m_junk       += (int)(TurretJunkCosts[turretIdx] * ratio);
            m_eleCircuit += (int)(TurretCircuitCosts[turretIdx] * ratio);

            UpdateRsrc();
        }

        TurretMgr.Inst.RemoveTurretOnTurretSupport();
        BattleGameObjectMgr.Inst.ExitWarnings();
        BattleGameObjectMgr.Inst.PopUpExit();

        return(true);
    }
Ejemplo n.º 3
0
    private Gunner FindFirstTurret(int planetArea)
    {
        if (planetArea < 0 || planetArea >= 4)
        {
            return(null);
        }

        int start = planetArea * 5;// 5 단위로 구역이 나뉨

        TurretCtrl turret = null;

        for (int i = start; i < start + 5; ++i)
        {
            if (m_turretSupportCtrs[i].TurretCtrl != null)
            {
                turret = m_turretSupportCtrs[i].TurretCtrl;
                break;
            }
        }

        return(turret);
    }
Ejemplo n.º 4
0
    private TurretCtrl TurretHP;//Soldier의 HP정보를 가져오기위한 변수


    void Start()
    {
        TurretHP = gameObject.GetComponent <TurretCtrl>();//HP정보를 가져오기위해서
    }