/// <summary> /// 技能於物件池中生成至畫面時(尚未開始詠唱與使用前) /// </summary> public virtual void GenerateSkill(Character character, Skill skill) { sourceCaster = character; currentSkill = skill; anim = GetComponent <Animator>(); soundControl = sourceCaster.opsc; // Active this.gameObject.SetActive(true); // 禁用技能Hitbox與貼圖 (避免生成技能時直接播放動畫與觸發效果) SetSkillCollisionEnable(false); if (soundControl != null && inRenderSound != null) { soundControl.PlaySound(inRenderSound); } }
private void Awake() { opsc = GetComponent <OperationSoundController>(); weaponController = GetComponent <WeaponController>(); opc = GetComponent <OperationController>(); skillController = GetComponent <SkillController>(); buffController = GetComponent <BuffController>(); combatController = GetComponent <CombatController>(); knockBackSystem = GetComponent <KnockStunSystem>(); dieController = GetComponent <DieController>(); iconController = GetComponent <IconController>(); cumulativeDataController = GetComponent <CumulativeDataController>(); rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); animController = new AnimatorOverrideController(anim.runtimeAnimatorController); _attack = new CommonAttackControl(this); anim.runtimeAnimatorController = animController; cycleAttackCount = data.cycleAttackCount; nextAttackResetTime = 0; attackComboCount = 0; ReBorn(); }