Пример #1
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>();
    }
Пример #2
0
 private void Awake()
 {
     mySon  = transform.GetChild(0).gameObject;
     SysMsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
     if (!suphp)
     {
         suphp = GetComponentInChildren <SupHP>();
     }
 }
Пример #3
0
    private void Awake()
    {
        if (!this.gameObject.name.Contains("Sup_Container"))
        {
            destroyEffect  = transform.GetChild(transform.childCount - 2).gameObject;
            destroyEffect2 = transform.GetChild(transform.childCount - 1).gameObject;
        }

        if (!sysmsg)
        {
            sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
        }

        //기본 설정
        InitTowerStat();
        InitAudio();
        stone   = transform.GetChild(0).gameObject;
        crystal = transform.GetChild(1).gameObject;
        supHp   = GetComponent <SupHP>();
    }