Example #1
0
        public override void Action(GameObject PlayerGO, GameObject EnemyGO)
        {
            Rigidbody2D rigi2d = EnemyGO.GetComponent <Rigidbody2D> ();

            if (Vector3.Distance(PlayerGO.transform.position, EnemyGO.transform.position) > chaseDistance)
            {
                Debug.Log("Patrol Action");
                FindNextPoint();
                rigi2d.velocity = tools.EnemyFilp2D(desPos, EnemyGO) * curSpeed;                 // turn to target
            }
        }
Example #2
0
        public override void Action(GameObject PlayerGO, GameObject EnemyGO)
        {
            tools.EnemyFilp2D(PlayerGO.transform.position, EnemyGO);
            Animator          anim     = EnemyGO.GetComponent <Animator> ();
            AnimatorStateInfo animinfo = anim.GetCurrentAnimatorStateInfo(0);

            Ctime += Time.deltaTime;
            if (Ctime >= AttackSpeed)
            {
                Ctime        = 0;
                AttackSpeed += Time.deltaTime;
                AllowAttack  = true;
            }
            else
            {
                AllowAttack = false;
            }
            EnemyGO.GetComponent <EnemyWIZController> ().IsAttack = AllowAttack;
        }
Example #3
0
 /// <summary>
 /// Enemy leave the Player
 /// </summary>
 /// <param name="PlayerGO">Player G.</param>
 /// <param name="EnemyGO">Enemy G.</param>
 public override void Action(GameObject PlayerGO, GameObject EnemyGO)
 {
     EnemyGO.GetComponent <Rigidbody2D> ().AddForce(-tools.EnemyFilp2D(PlayerGO.transform.position, EnemyGO) * 300f);
     LoadSource.Instance.CreateSword(EnemyGO, 3.5f, 5f);
     LoadSource.Instance.CreateSword(EnemyGO, 1.2f, 8f);
 }
Example #4
0
        public override void Action(GameObject PlayerGO, GameObject EnemyGO)
        {
            Rigidbody2D rigi2d = EnemyGO.GetComponent <Rigidbody2D> ();

            rigi2d.velocity = tools.EnemyFilp2D(PlayerGO.transform.position, EnemyGO) * curSpeed;
        }
Example #5
0
 public override void Action(GameObject PlayerGO, GameObject EnemyGO)
 {
     tools.EnemyFilp2D(PlayerGO.transform.position, EnemyGO);
 }