public void OnTriggerEnter(Collider other) { if (status.minstate == MinionState.MinState.Death) { return; } if (other.gameObject.tag == "Atk1")// || other.gameObject.tag == "EnemyAtk") { parent = other.transform.root.gameObject; CharacterTotalState tState = parent.GetComponent <CharacterTotalState>(); //status.CurrentHp--; // Debug.Log(tState.Ta); // minBar.HpDown(tState.Ta); if (tState != null) { status.CurrentHp -= tState.Ta; } GameObject effect = Instantiate(damageEffect, transform.position, Quaternion.identity); Destroy(effect, 1.0f); } if (other.gameObject.tag == "Atk2") { parent = other.GetComponent <MagicDamage>().parent; } if (other.gameObject.tag == "Atk3") { parent = other.GetComponent <MagicDamage2>().parent; } }
void Start() { player = GetComponent <Transform>(); // enemy = GameObject.FindGameObjectWithTag("Enemy").GetComponent<Transform>(); anim = GetComponent <Animator>(); navi = GetComponent <NavMeshAgent>(); animator = GetComponent <CharacterAnimatior>(); state = GetComponent <CharacterStates>(); // miniState = GameObject.FindGameObjectWithTag("Enemy").GetComponent<MinionState>(); prop = GetComponent <PropManager>(); if (photonView.isMine) { Camera.main.GetComponent <FollowCamera>().player = camPivot; } skillManager = GameObject.Find("UI/CharacterStateInfo/Skll").GetComponent <SkillManager>(); total = GetComponent <CharacterTotalState>(); parent = transform.root.gameObject; genPoints = GameObject.Find("PlayerGenpoints").GetComponentsInChildren <Transform>(); }
void Start() { state = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterStates>(); tState = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterTotalState>(); attackPower = GameObject.Find("UI/CharacterStateInfo/StateInfo 1/Text (1)").GetComponent <Text>(); defencePower = GameObject.Find("UI/CharacterStateInfo/StateInfo 1/Text (2)").GetComponent <Text>(); }