Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     state              = cowState.Idle;                     //初始化初始状态
     animall_now        = animall_idle;                      //初始化初始动画
     aniname_attack_now = aniname_normalattack1;             //初始化攻击动画
     cc        = this.GetComponent <CharacterController>();
     player    = GameObject.FindGameObjectWithTag("Player"); //获取玩家对象
     target    = player.transform;                           //获取玩家的位置
     animation = GetComponent <Animation>();
     addAnimationEvent(aniname_normalattack1, "controlHP1");
     addAnimationEvent(aniname_normalattack2, "controlHP2");
     addAnimationEvent(aniname_normalattack3, "controlHP3");
     addAnimationEvent(aniname_crazyattack, "controlHP4");
     c = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterAttackSystem>();
 }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        state1              = storemanstate1.Idle;                        //初始化初始状态
        hp                  = 1000;
        animall_now1        = animall_idle1;                              //初始化初始动画
        aniname_attack_now1 = aniname_normal1attack1_1;                   //初始化攻击动画
        cc1                 = this.GetComponent <CharacterController>();
        player1             = GameObject.FindGameObjectWithTag("Player"); //获取玩家对象
        target1             = player1.transform;                          //获取玩家的位置
        animation1          = GetComponent <Animation>();

        addAnimationEvent(aniname_normal1attack1_1, "controlhp");
        addAnimationEvent(aniname_normal1attack2_1, "controlHP2");
        addAnimationEvent(aniname_normal1attack3_1, "controlHP3");
        addAnimationEvent(aniname_normal1attack4_1, "controlHP4");
        addAnimationEvent(aniname_crazyattack_1, "controlHP5");
        c = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterAttackSystem>();
    }
Пример #3
0
 // Start is called before the first frame update
 void Start()
 {
     move      = this.GetComponent <Player_contrller>();
     animation = this.GetComponent <Animation>();
     attack    = this.GetComponent <CharacterAttackSystem>();
 }
Пример #4
0
 void Start()
 {
     ps = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <PlayerStatus>();
     pa = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <CharacterAttackSystem>();
 }