コード例 #1
0
ファイル: GameManager.cs プロジェクト: 1010MMR/Portfolio
 public void AddPlacedTower(int index, TowerPlacedInfo towerInfo)
 {
     if (placedTowerArray != null)
     {
         placedTowerArray[index] = towerInfo;
     }
 }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: 1010MMR/Portfolio
    public bool FindPlacedTower(int index, out TowerPlacedInfo towerInfo)
    {
        towerInfo = null;

        if (placedTowerArray != null)
        {
            if (placedTowerArray.Length > index && placedTowerArray[index] != null)
            {
                towerInfo = placedTowerArray[index];
                return(true);
            }
        }

        return(false);
    }
コード例 #3
0
ファイル: Tower.cs プロジェクト: 1010MMR/Portfolio
    public void Init(TowerPlaceToken token, TowerPlacedInfo info)
    {
        if (gameObject.activeSelf == false)
        {
            gameObject.SetActive(true);
        }

        StopAllCoroutines();

        gameObject.transform.localPosition = token.obj.transform.localPosition;
        status = new TowerStatus(this, token.FloorIndex, info);

        SetAtlas();

        if (TowerManager.Instance != null)
        {
            TowerManager.Instance.AddTowerList(this);
        }

        StartCoroutine("AttackMode");
    }
コード例 #4
0
ファイル: Tower.cs プロジェクト: 1010MMR/Portfolio
    public TowerStatus(Tower tower, int floorIndex, TowerPlacedInfo info)
    {
        TowerBaseInfo towerBaseInfo = null;

        if (ClientManager.Instance != null && ClientManager.Instance.FindTowerBaseInfo(info.tableID, out towerBaseInfo))
        {
            this.tower      = tower;
            this.towerObj   = tower.transform;
            this.table      = towerBaseInfo.GetTable();
            this.floorIndex = floorIndex;

            this.level        = info.level;
            this.enchantLevel = towerBaseInfo.enchantLevel;

            this.attackSpeed = table.attackSpeed;
            this.attackRange = table.attackRange;

            this.buffList = new List <BuffParam>();

            if (TowerAddValueTable.Instance != null &&
                TowerAddValueTable.Instance.FindTable(table.id, out addValueTableList))
            {
                this.curDamage  = table.damage + addValueTableList[Mathf.Clamp(this.level, 0, addValueTableList.Count - 1)].addDamageValue;
                this.curDamage += Mathf.RoundToInt(this.curDamage * this.enchantLevel * TowerAddValueTable.ENCHANT_ADD_FACTOR);
            }

            if (EffectTable.Instance != null)
            {
                EffectTable.Instance.FindTable(towerBaseInfo.GetTable().attackEffectID, out effectTable);
            }

            towerObj.localRotation = (floorIndex.Equals(0) || (floorIndex % 2).Equals(0)) ?
                                     Quaternion.Euler(Vector3.up * -180.0f) : Quaternion.Euler(Vector3.zero);

            this.curTargetEnemy = null;
        }
    }