void Start() { rb = GetComponent <Rigidbody2D>(); sprite = transform.Find("sprite").gameObject; animator = sprite.GetComponent <Animator>(); anime_para_list = new List <int>(); foreach (AnimatorControllerParameter parameter in animator.parameters) { anime_para_list.Add(parameter.nameHash); } foreach (Transform child in transform.Find("skills")) { GameObject child_obj = child.gameObject; skills.Add(child_obj); child.gameObject.SetActive(false); attack attack = child_obj.GetComponent <attack>(); if (attack != null) { attack.set_attacker(this); } } ec = GameObject.Find("effect_controller").GetComponent <effect_controller>(); ac = GameObject.Find("audio_controller").GetComponent <audio_controller>(); sc = GameObject.Find("spell_controller").GetComponent <spell_controller>(); bc = GameObject.Find("buff_controller").GetComponent <buff_controller>(); Start2(); }
void Start() { parent = transform.parent.gameObject; bearer = parent.GetComponent <charactor> (); player = GameObject.Find("hero").GetComponent <player> (); rb = parent.GetComponent <Rigidbody2D> (); ec = GameObject.Find("effect_controller").GetComponent <effect_controller> (); ac = GameObject.Find("audio_controller").GetComponent <audio_controller> (); bc = GameObject.Find("buff_controller").GetComponent <buff_controller> (); }
void Start() { parent = transform.parent.gameObject; bearer = parent.GetComponent <enemy> (); if (bearer == null) { bearer = parent.GetComponent <player> (); } rb = parent.GetComponent <Rigidbody2D> (); ec = GameObject.Find("effect_controller").GetComponent <effect_controller> (); ac = GameObject.Find("audio_controller").GetComponent <audio_controller> (); bc = GameObject.Find("buff_controller").GetComponent <buff_controller> (); }