Esempio n. 1
0
    private void Awake()
    {
        towerHP = transform.GetComponent <TowerHP>();
        if (!sysmsg)
        {
            sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
        }
        towerstat               = new StatClass.Stat();
        towerstat.Hp            = HP;
        towerstat.MaxHp         = HP;
        towerstat.Attack_Damage = attack_Damage;
        towerstat.Attack_Def    = defence;
        towerstat.Ability_Def   = defence;
        towerstat.Attack_Speed  = 0.83f;
        towerstat.Level         = 1;
        if (TowerDestroyEffect)
        {
            TowerDestroyEffect.SetActive(false);
            DestroyEffect = TowerDestroyEffect.GetComponent <ParticleSystem>();
        }

        toweraudio              = GetComponent <AudioSource>();
        toweraudio.minDistance  = 1.0f;
        toweraudio.maxDistance  = 30.0f;
        toweraudio.volume       = 0.5f;
        toweraudio.spatialBlend = 0.5f;
        toweraudio.rolloffMode  = AudioRolloffMode.Linear;
    }
Esempio n. 2
0
    private void Awake()
    {
        myPhotonView = GetComponent <PhotonView>();
        if (photonView.isMine)
        {
            championName = PlayerData.Instance.championName;
            if (championName.Contains("Mundo"))
            {
                isNoMP = true;
            }
            SetSpell();
            SetStatSkill(championName);

            item = PlayerData.Instance.item;
        }
        else
        {
            item = new int[6];
        }
        totalStat = myStat.ClassCopy();

        myAIDestinationSetter = GetComponent <Pathfinding.AIDestinationSetter>();
        myAnimator            = GetComponent <Animator>();
        theAIPath             = GetComponent <AIPath>();
        playerSpell           = GetComponent <PlayerSpell>();
        playerData            = PlayerData.Instance;
        audioSource           = GetComponent <AudioSource>();

        int ran = Random.Range(1, 9);

        redPos  = new Vector3(4 + ran, 0.5f, 10f);
        bluePos = new Vector3(262 + ran, 0.5f, 270f);
    }
Esempio n. 3
0
    private void Awake()
    {
        if (!this.gameObject.name.Contains("Sup_Container"))
        {
            Destroy_Effect  = transform.GetChild(transform.childCount - 2).gameObject;
            Destroy_Effect2 = transform.GetChild(transform.childCount - 1).gameObject;
        }


        if (!sysmsg)
        {
            sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
        }
        towerstat              = new StatClass.Stat();
        towerstat.Hp           = HP;
        towerstat.MaxHp        = HP;
        towerstat.Attack_Def   = defence;
        towerstat.Ability_Def  = defence;
        towerstat.Attack_Speed = 0.83f;
        towerstat.Level        = 1;
        Audio = GetComponentInParent <AudioSource>();
        if (!Audio)
        {
            Audio = gameObject.AddComponent <AudioSource>();
        }
        Audio.maxDistance = 20;
        Audio.volume      = 0.5f;
        Stone             = transform.GetChild(0).gameObject;
        crystal           = transform.GetChild(1).gameObject;
        suphp             = GetComponent <SupHP>();
    }
 /// <summary>
 /// 건물의 초기 값을 설정하는 함수
 /// </summary>
 private void InitTowerStat()
 {
     towerStat             = new StatClass.Stat();
     towerStat.Hp          = HP;
     towerStat.MaxHp       = HP;
     towerStat.AttackDef   = defence;
     towerStat.AbilityDef  = defence;
     towerStat.AttackSpeed = 0.83f;
     towerStat.Level       = 1;
 }
Esempio n. 5
0
 private void Awake()
 {
     animation  = GetComponent <Animation>();
     animator   = GetComponent <Animator>();
     stats      = new StatClass.Stat();
     Targets    = new Dictionary <GameObject, Vector3>();
     Players    = new List <GameObject>();
     status     = Status.Move;
     attackTime = stats.Attack_Speed;
 }
Esempio n. 6
0
 public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
 {
     if (stream.isWriting)
     {
         // We own mystat player: send the others our data
         stream.SendNext(mystat);
     }
     else
     {
         // Network player, receive data
         mystat = (StatClass.Stat)stream.ReceiveNext();
     }
 }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        GameObject Player = GameObject.FindGameObjectWithTag("Player");

        if (Player == null)
        {
            StructureSetting.instance.ActiveTrue();
            Player = GameObject.FindGameObjectWithTag("Player");
        }
        ChampionData cd = Player.GetComponent <ChampionData>();

        stat = cd.mystat;
        ChampionIcon.sprite = Resources.Load <Sprite>("ChampionIcon/" + cd.ChampionName);
    }
Esempio n. 8
0
    public void SetStat(int i)
    {
        if (monsterJsonName.Contains("Dragon") || monsterJsonName.Contains("Golem"))
        {
            i = 0;
        }
        switch (i)
        {
        case 0:
            stat = StatClass.instance.characterData[monsterJsonName].ClassCopy();
            break;

        case 1:
            stat = StatClass.instance.characterData[monsterJsonName + "2"].ClassCopy();
            break;
        }
    }
Esempio n. 9
0
    /// <summary>
    /// 몬스터의 기본 스텟값을 설정하는 함수
    /// </summary>
    /// <param name="powerUp">한 번 죽은 후 강해지는 몬스터들을 위한 변수. 처음 설정할 때는 0, 죽고 부활한 경우는 1</param>
    public void SetStat(int powerUp)
    {
        //드래곤이나 골렘의 경우 죽어서 부활해도 더 강해지지 않으므로 0으로 고정
        if (monsterJsonName.Contains("Dragon") || monsterJsonName.Contains("Golem"))
        {
            powerUp = 0;
        }

        switch (powerUp)
        {
        case 0:
            stat = StatClass.Instance.characterData[monsterJsonName].ClassCopy();
            break;

        case 1:
            stat = StatClass.Instance.characterData[monsterJsonName + "2"].ClassCopy();
            break;
        }
    }
Esempio n. 10
0
    public void ApplyObject(GameObject go)
    {
        selectedObject = go;

        // 챔피언을 눌렀을때
        if (go.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            selectType           = SelectType.Player;
            selectedChampionData = go.GetComponent <ChampionData>();

            // 챔피언의 스탯을 가져와서 스탯업데이트
            stat       = selectedChampionData.totalStat;
            originStat = selectedChampionData.myStat;
            StatUpdate();

            // 챔피언의 아이콘을 가져와서 아이콘 업데이트
            icon.sprite = Resources.Load <Sprite>("Champion/ChampionIcon/" + selectedChampionData.championName);

            // 챔피언의 아이템을 가져와서 아이템 업데이트
            ItemUpdate();
        }

        else if (go.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            selectType = SelectType.Monster;
            selectedMonsterBehaviour = go.GetComponent <MonsterBehaviour>();
            stat = selectedMonsterBehaviour.stat;
            StatUpdate();
            string monsterName = go.name;
            icon.sprite = Resources.Load <Sprite>("Icon/Monster/" + monsterName.Split('(')[0]);
        }

        // 미니언을 눌렀을때
        else if (go.CompareTag("Minion"))
        {
            selectType = SelectType.Minion;
            selectedMinionBehaviour = go.GetComponent <MinionBehavior>();

            stat = selectedMinionBehaviour.stat;
            StatUpdate();

            if (selectedMinionBehaviour.name.Contains("Red"))
            {
                if (selectedMinionBehaviour.name.Contains("Magician"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_caster_red");
                }
                else if (selectedMinionBehaviour.name.Contains("Melee"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_melee_red");
                }
                else if (selectedMinionBehaviour.name.Contains("Siege"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_siege_red");
                }
            }
            else if (selectedMinionBehaviour.name.Contains("Blue"))
            {
                if (selectedMinionBehaviour.name.Contains("Magician"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_caster_blue");
                }
                else if (selectedMinionBehaviour.name.Contains("Melee"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_melee_blue");
                }
                else if (selectedMinionBehaviour.name.Contains("Siege"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_siege_blue");
                }
            }
            else
            {
                icon.sprite = null;
            }

            for (int i = 0; i < itemicon.Length; i++)
            {
                itemicon[i].gameObject.GetComponent <ItemInfo>().myItem = null;
                itemicon[i].sprite = null;
                itemicon[i].color  = new Color(14f / 255f, 26f / 255f, 23f / 255f, 1);
            }
        }

        // 타워를 눌렀을때
        else if (go.CompareTag("Tower"))
        {
            selectType             = SelectType.Tower;
            selectedTowerBehaviour = go.GetComponent <TowerBehaviour>();

            stat = selectedTowerBehaviour.towerstat;
            StatUpdate();

            if (selectedTowerBehaviour.Team.Equals("Red"))
            {
                icon.sprite = Resources.Load <Sprite>("Icon/Tower_Icon_Red");
            }
            else if (selectedTowerBehaviour.Team.Equals("Blue"))
            {
                icon.sprite = Resources.Load <Sprite>("Icon/Tower_Icon_Blue");
            }
            else
            {
                icon.sprite = null;
            }

            for (int i = 0; i < itemicon.Length; i++)
            {
                itemicon[i].gameObject.GetComponent <ItemInfo>().myItem = null;
                itemicon[i].sprite = null;
                itemicon[i].color  = new Color(14f / 255f, 26f / 255f, 23f / 255f, 1);
            }
        }
    }
Esempio n. 11
0
File: UIStat.cs Progetto: kunana/AOS
 // Use this for initialization
 void Start()
 {
     stat       = GameObject.FindGameObjectWithTag("Player").GetComponent <ChampionData>().totalstat;
     originstat = GameObject.FindGameObjectWithTag("Player").GetComponent <ChampionData>().mystat;
     Refresh();
 }
Esempio n. 12
0
 public void SetStat(string championName)
 {
     stat = StatClass.instance.characterData[championName].ClassCopy();
 }
Esempio n. 13
0
 public void SetStatSkill(string championName)
 {
     myStat           = StatClass.Instance.characterData[championName].ClassCopy();
     mySkill          = SkillClass.Instance.skillData[championName].ClassCopy();
     Cooldown_Passive = mySkill.passiveCooldown;
 }
Esempio n. 14
0
 /// <summary>
 /// 미니언의 기본 스텟값을 설정하는 함수
 /// </summary>
 /// <param name="minionName">데이터를 가져오기 위한 미니언의 종류</param>
 private void SetStat(string minionName)
 {
     stat = StatClass.Instance.characterData[minionName].ClassCopy();
 }
Esempio n. 15
0
    public void ApplyObject(GameObject go)
    {
        selectedObject = go;

        // 챔피언을 눌렀을때
        if (go.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            selectType = SelectType.player;
            cd         = go.GetComponent <ChampionData>();

            // 챔피언의 스탯을 가져와서 스탯업데이트
            stat       = cd.totalstat;
            originstat = cd.mystat;
            StatUpdate();

            // 챔피언의 아이콘을 가져와서 아이콘 업데이트
            icon.sprite = Resources.Load <Sprite>("Champion/ChampionIcon/" + cd.ChampionName);

            // 챔피언의 아이템을 가져와서 아이템 업데이트
            ItemUpdate();
        }

        else if (go.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            selectType = SelectType.monster;
            monB       = go.GetComponent <MonsterBehaviour>();
            stat       = monB.stat;
            StatUpdate();
            icon.sprite = null;
        }

        // 미니언을 눌렀을때
        else if (go.CompareTag("Minion"))
        {
            selectType = SelectType.minion;
            mb         = go.GetComponent <MinionBehavior>();

            stat = mb.stat;
            StatUpdate();

            if (mb.name.Contains("Red"))
            {
                if (mb.name.Contains("Magician"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_caster_red");
                }
                else if (mb.name.Contains("Melee"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_melee_red");
                }
                else if (mb.name.Contains("Siege"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_siege_red");
                }
            }
            else if (mb.name.Contains("Blue"))
            {
                if (mb.name.Contains("Magician"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_caster_blue");
                }
                else if (mb.name.Contains("Melee"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_melee_blue");
                }
                else if (mb.name.Contains("Siege"))
                {
                    icon.sprite = Resources.Load <Sprite>("Icon/Minion_siege_blue");
                }
            }
            else
            {
                icon.sprite = null;
            }

            for (int i = 0; i < itemicon.Length; i++)
            {
                itemicon[i].gameObject.GetComponent <ItemInfo>().myItem = null;
                itemicon[i].sprite = null;
                itemicon[i].color  = new Color(14f / 255f, 26f / 255f, 23f / 255f, 1);
            }
        }

        // 타워를 눌렀을때
        else if (go.CompareTag("Tower"))
        {
            selectType = SelectType.tower;
            tb         = go.GetComponent <TowerBehaviour>();

            stat = tb.towerstat;
            StatUpdate();

            if (tb.Team.Equals("Red"))
            {
                icon.sprite = Resources.Load <Sprite>("Icon/Tower_Icon_Red");
            }
            else if (tb.Team.Equals("Blue"))
            {
                icon.sprite = Resources.Load <Sprite>("Icon/Tower_Icon_Blue");
            }
            else
            {
                icon.sprite = null;
            }

            for (int i = 0; i < itemicon.Length; i++)
            {
                itemicon[i].gameObject.GetComponent <ItemInfo>().myItem = null;
                itemicon[i].sprite = null;
                itemicon[i].color  = new Color(14f / 255f, 26f / 255f, 23f / 255f, 1);
            }
        }
    }