Ejemplo n.º 1
0
    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();
    }
    private void SwordFXControl()
    {
        if (attackTimer > 0.0f)
        {
            if (animator.GetCurrentAnimatorClipInfoCount(0) == 0)
            {
                return;
            }
            var clipInfo  = animator.GetCurrentAnimatorClipInfo(0)[0];
            var clip      = clipInfo.clip;
            var stateInfo = animator.GetCurrentAnimatorStateInfo(0);

            AnimatedTextureExtendedUV animation = null;
            switch (attackMotion)
            {
            default:
            case AttackMotion.Right:
                animation = attackLeftTail;
                break;

            case AttackMotion.Left:
                animation = attackRightTail;
                break;
            }

            float startFrame  = 2.5f;
            float startTime   = startFrame / clip.frameRate;
            float currentTime = stateInfo.normalizedTime * stateInfo.length;

            if (currentTime >= startTime)
            {
                animation.Play(currentTime - startTime);
            }
        }
    }
Ejemplo n.º 3
0
    //----------------------------------------------------------------//

    // 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();
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        animateTexture = GetComponent <AnimatedTextureExtendedUV>();

        monsterFeet = GetComponent <MonsterFeet>();
    }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     animateTexture = gameObject.GetComponent <AnimatedTextureExtendedUV>();
 }
    // -------------------------------------------------------------------------------- //
    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();
    }
Ejemplo n.º 8
0
 void Awake()
 {
     spriteSheet = GetComponent <AnimatedTextureExtendedUV>();
 }
Ejemplo n.º 9
0
 public override void EnteringState()
 {
     Owner.Animator.CurrentAnimation = Animations.P_Hurt;
     animation       = Owner.GetComponent <AnimatedTextureExtendedUV>();
     animation.Blink = true;
 }
Ejemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        animateTexture = GetComponent<AnimatedTextureExtendedUV>();

        monsterFeet = GetComponent<MonsterFeet>();
    }