コード例 #1
0
 void Awake()
 {
     attribute = GetComponent <NpcAttribute> ();
     //controller = GetComponent<CharacterController> ();
     myAnimationEvent = GetComponent <MyAnimationEvent> ();
     targetPlayer     = null;
 }
コード例 #2
0
ファイル: StoryNpcAI.cs プロジェクト: itcodes/unityRpg
        //CharacterController controller;

        void Awake()
        {
            attribute        = GetComponent <NpcAttribute> ();
            myAnimationEvent = GetComponent <MyAnimationEvent>();
            //controller = GetComponent<CharacterController>();
            animation.Play("idle");
            animation ["idle"].wrapMode = WrapMode.Loop;
            //GetComponent<ShadowComponent> ().CreateShadowPlane ();
        }
コード例 #3
0
ファイル: NpcAI.cs プロジェクト: renBuWen/u3dDemoRPG
        //inside birth circle
        void Awake()
        {
            myAnimationEvent = GetComponent <MyAnimationEvent>();
            _characterState  = CharacterState.Idle;

            controller            = GetComponent <CharacterController>();
            heading               = Random.Range(0, 360);
            transform.eulerAngles = new Vector3(0, heading, 0);
            StartCoroutine(NewHeading());
            StartCoroutine(FindTarget());
            //StartCoroutine(CheckOnHit());
        }
コード例 #4
0
        void Awake()
        {
            animationEvent = GetComponent <MyAnimationEvent>();

            allAttackAni = new List <string>()
            {
                "attack", "attack2"
            };

            _characterState = CharacterState.Idle;
            moveDirection   = transform.TransformDirection(Vector3.forward);
        }
コード例 #5
0
ファイル: ShanShuoAI.cs プロジェクト: itcodes/unityRpg
        void Awake()
        {
            attribute             = GetComponent <NpcAttribute>();
            myAnimationEvent      = GetComponent <MyAnimationEvent>();
            heading               = Random.Range(0, 360);
            transform.eulerAngles = new Vector3(0, heading, 0);

            ai           = new MonsterCharacter();
            ai.attribute = attribute;
            ai.AddState(new MonsterIdle());
            ai.AddState(new MonsterCombat());
            ai.AddState(new MonsterDead());
            ai.AddState(new MonsterFlee());
            ai.AddState(new MonsterKnockBack());
            ai.AddState(new MonsterSkill());
        }
コード例 #6
0
ファイル: LangAI.cs プロジェクト: itcodes/unityRpg
        void Awake()
        {
            attribute             = GetComponent <NpcAttribute>();
            myAnimationEvent      = GetComponent <MyAnimationEvent>();
            heading               = Random.Range(0, 360);
            transform.eulerAngles = new Vector3(0, heading, 0);

            ai           = new MonsterCharacter();
            ai.attribute = attribute;
            ai.AddState(new MonsterIdle());
            ai.AddState(new MonsterCombat());
            ai.AddState(new MonsterDead());
            ai.AddState(new MonsterFlee());
            ai.AddState(new MonsterKnockBack());
            ai.AddState(new MonsterSkill());

            this.regEvt = new System.Collections.Generic.List <MyEvent.EventType>()
            {
                MyEvent.EventType.WolfCall,
            };
            RegEvent();
        }
コード例 #7
0
 void Awake()
 {
     commonAI       = GetComponent <CommonAI> ();
     animationEvent = GetComponent <MyAnimationEvent> ();
 }