public static SpawnAnimateObject ( RuntimeAnimatorController anim, int orderLayer = 15 ) : GameObject | ||
anim | RuntimeAnimatorController | anim assign |
orderLayer | int | sorting order |
return | GameObject |
/// <summary> /// Active the skill. /// </summary> public void ActiveSkill() { if (mSkillAnim == null) { JCS_Debug.LogReminder( "Assigning active skill action without animation is not allowed."); return; } GameObject obj = JCS_Util.SpawnAnimateObject(mSkillAnim, mOrderLayer); if (mSamePosition) { obj.transform.position = this.transform.position; } if (mSameRotation) { obj.transform.rotation = this.transform.rotation; } // if stay with player, simple set the position to // same position and set to child so it will follows // the active target! if (mStayWithActiveTarget) { obj.transform.SetParent(this.transform); } // add anim death event, // so when animation ends destroy itself. obj.AddComponent <JCS_DestroyAnimEndEvent>(); }