public void Start() { this.animator = this.GetComponentInChildren <Animator>(); this.attack_collider = GameObject.FindGameObjectWithTag("AttackCollider").GetComponent <AttackColliderControl>(); this.attack_collider.player = this; this.kiseki_left = GameObject.FindGameObjectWithTag("FX_Kiseki_L").GetComponent <AnimatedTextureExtendedUV>(); this.kiseki_left.StopPlay(); this.kiseki_right = GameObject.FindGameObjectWithTag("FX_Kiseki_R").GetComponent <AnimatedTextureExtendedUV>(); this.kiseki_right.StopPlay(); this.fx_hit = GameObject.FindGameObjectWithTag("FX_Hit").GetComponent <ParticleSystem>(); this.fx_run = GameObject.FindGameObjectWithTag("FX_Run").GetComponent <ParticleSystem>(); this.run_speed = 0.0f; this.next_step = STEP.RUN; this.attack_voice_audio = this.gameObject.AddComponent <AudioSource>(); this.sword_audio = this.gameObject.AddComponent <AudioSource>(); this.miss_audio = this.gameObject.AddComponent <AudioSource>(); this.run_audio = this.gameObject.AddComponent <AudioSource>(); this.run_audio.clip = this.runSound; this.run_audio.loop = true; this.run_audio.Play(); }
void Start() { this.attack_collider = GameObject.FindGameObjectWithTag("AttackCollider").GetComponent <AttackColliderControl>(); this.attack_collider.player = this; // 开始 this.run_speed = 0.0f; this.next_state = STATE.RUN; }
// Use this for initialization void Start() { animator = GetComponentInChildren <Animator>(); attackCollider = GameObject.FindGameObjectWithTag("AttackCollider").GetComponent <AttackColliderControl>(); attackCollider.player = this; attackLeftTail.Stop(); attackRightTail.Stop(); attackVoiceAudio = gameObject.AddComponent <AudioSource>(); swordAudio = gameObject.AddComponent <AudioSource>(); missAudio = gameObject.AddComponent <AudioSource>(); runAudio = gameObject.AddComponent <AudioSource>(); runAudio.clip = runSound; runAudio.loop = true; runAudio.Play(); runSpeed = 0.0f; nextState = State.Run; }
//----------------------------------------------------------------// // Use this for initialization void Start() { //Vector3 new_velocity = this.GetComponent<Rigidbody>().velocity; //查找用于攻击判定的碰撞器 this.attack_collider = GameObject.FindGameObjectWithTag("AttackCollider").GetComponent <AttackColliderControl>(); //设置用于攻击判定的碰撞器的玩家实例 this.attack_collider.player = this; //剑的轨迹特效 this.kisski_left = GameObject.FindGameObjectWithTag("FX_Kiseki_L").GetComponent <AnimatedTextureExtendedUV>(); this.kisski_left.stopPlay(); this.kisski_right = GameObject.FindGameObjectWithTag("FX_Kiseki_R").GetComponent <AnimatedTextureExtendedUV>(); this.kisski_right.stopPlay(); //击中时的特效 this.fx_hit = GameObject.FindGameObjectWithTag("FX_Hit").GetComponent <ParticleSystem>(); this.fx_run = GameObject.FindGameObjectWithTag("FX_Run").GetComponent <ParticleSystem>(); // this.run_speed = 0.0f; this.next_step = Step.Run; this.attack_voice_audio = this.gameObject.AddComponent <AudioSource>(); this.sword_audio = this.gameObject.AddComponent <AudioSource>(); this.miss_audio = this.gameObject.AddComponent <AudioSource>(); this.run_audio = this.gameObject.AddComponent <AudioSource>(); this.run_audio.clip = this.runSound; this.run_audio.loop = true; this.run_audio.Play(); }
// -------------------------------------------------------------------------------- // void Start() { // 攻撃判定用コライダーを探しておく. this.attack_collider = GameObject.FindGameObjectWithTag("AttackCollider").GetComponent <AttackColliderControl>(); // 攻撃判定用コライダーにプレイヤーのインスタンスをセットしておく. this.attack_collider.player = this; // 剣の軌跡エフェクト. this.kiseki_left = GameObject.FindGameObjectWithTag("FX_Kiseki_L").GetComponent <AnimatedTextureExtendedUV>(); this.kiseki_left.stopPlay(); this.kiseki_right = GameObject.FindGameObjectWithTag("FX_Kiseki_R").GetComponent <AnimatedTextureExtendedUV>(); this.kiseki_right.stopPlay(); // ヒットエフェクト. this.fx_hit = GameObject.FindGameObjectWithTag("FX_Hit").GetComponent <ParticleSystem>(); this.fx_run = GameObject.FindGameObjectWithTag("FX_Run").GetComponent <ParticleSystem>(); // this.run_speed = 0.0f; this.next_step = STEP.RUN; this.attack_voice_audio = this.gameObject.AddComponent <AudioSource>(); this.sword_audio = this.gameObject.AddComponent <AudioSource>(); this.miss_audio = this.gameObject.AddComponent <AudioSource>(); this.run_audio = this.gameObject.AddComponent <AudioSource>(); this.run_audio.clip = this.runSound; this.run_audio.loop = true; this.run_audio.Play(); }
// -------------------------------------------------------------------------------- // void Start() { // 攻撃判定用コライダーを探しておく. this.attack_collider = GameObject.FindGameObjectWithTag("AttackCollider").GetComponent<AttackColliderControl>(); // 攻撃判定用コライダーにプレイヤーのインスタンスをセットしておく. this.attack_collider.player = this; // 剣の軌跡エフェクト. this.kiseki_left = GameObject.FindGameObjectWithTag("FX_Kiseki_L").GetComponent<AnimatedTextureExtendedUV>(); this.kiseki_left.stopPlay(); this.kiseki_right = GameObject.FindGameObjectWithTag("FX_Kiseki_R").GetComponent<AnimatedTextureExtendedUV>(); this.kiseki_right.stopPlay(); // ヒットエフェクト. this.fx_hit = GameObject.FindGameObjectWithTag("FX_Hit").GetComponent<ParticleSystem>(); this.fx_run = GameObject.FindGameObjectWithTag("FX_Run").GetComponent<ParticleSystem>(); // this.run_speed = 0.0f; this.next_step = STEP.RUN; this.attack_voice_audio = this.gameObject.AddComponent<AudioSource>(); this.sword_audio = this.gameObject.AddComponent<AudioSource>(); this.miss_audio = this.gameObject.AddComponent<AudioSource>(); this.run_audio = this.gameObject.AddComponent<AudioSource>(); this.run_audio.clip = this.runSound; this.run_audio.loop = true; this.run_audio.Play(); }