public virtual void release(KGCharacterController releaser, AttackEffect ae)
 {
     m_SkeletonAnimation.AnimationName = ae.name;
     m_SkeletonAnimation.timeScale = ae.timeScale;
     m_Transform.localScale = new Vector3(releaser.character.xDirection * m_Transform.localScale.x, 1, 1);
     m_curAttack = new Attack(releaser, ae, releaser.character.xDirection);
 }
Exemple #2
0
 public override void end(KGCharacterController cc)
 {
     base.end(cc);
     KGEnemyController ec = (KGEnemyController)cc;
     ec.transform.parent.Find("Collider/General/base").GetComponent<CircleCollider2D>().enabled = false;
     GameObject.Destroy(ec.transform.parent.gameObject);
 }
Exemple #3
0
 public override void begin(KGCharacterController cc)
 {
     if (audioClip != null)
     {
         KGEnemyController ec = (KGEnemyController)cc;
         ec.PlaySound(audioClip);
     }
     base.begin(cc);
 }
Exemple #4
0
 protected virtual void DefencableExecute(KGCharacterController cc) {
     KGEnemyController ec = (KGEnemyController)cc;
     if (ec.hitAttacks.Count != 0)
     {
         ec.DoDefence();
     }
     if (animCurve != null) cc.transform.Translate(Time.deltaTime * (cc.character.xDirection * animCurve.Evaluate(Time.time - startTime) * xTransfer * Vector2.right));
     else cc.transform.Translate(Time.deltaTime * (cc.character.xDirection * xTransfer * Vector2.right));
 }
Exemple #5
0
 public override void execute(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController)cc;
     if (cc.hitAttacks.Count != 0) {
         ec.hitAttackHandle();
     }
     else {
         if (ec.m_SkeletonAnim.state.GetCurrent(0).time >= ec.m_SkeletonAnim.state.GetCurrent(0).endTime) {
             //ec.character.curState = ec.g_behavior;
             //ec.g_behavior.begin(cc);
         }
     }
 }
Exemple #6
0
 public override void execute(KGCharacterController cc)
 {
     SpiderQueenController sqc = (SpiderQueenController)cc;
     if (!startFall)
     {
         float rate = 1 - sqc.m_SkeletonAnim.state.GetCurrent(0).time / startFallTime;
         if (rate > 0)
         {
             sqc.rigid2D.velocity = Vector2.up * yTransfer * rate;
         }
         else
         {
             sqc.rigid2D.velocity -= Vector2.up * sqc.rigid2D.velocity.y;
             startFall = true;
         }
     }
     sqc.transform.Translate(xTransfer * Time.deltaTime * Vector3.right * sqc.character.xDirection);
 }
Exemple #7
0
 public virtual void end(KGCharacterController cc) { }
Exemple #8
0
 public virtual void begin(KGCharacterController cc)
 {
     startTime = Time.time;
 }
Exemple #9
0
 public virtual void execute(KGCharacterController cc)
 {
     if (animCurve != null) cc.transform.Translate(Time.deltaTime * (cc.character.xDirection * animCurve.Evaluate(Time.time - startTime) * xTransfer * Vector2.right));
     else cc.transform.Translate(Time.deltaTime * (cc.character.xDirection * xTransfer * Vector2.right));
 }
Exemple #10
0
 public override void execute(KGCharacterController cc)
 {
     DefencableExecute(cc);
 }
Exemple #11
0
 public override void end(KGCharacterController cc)
 {
     base.end(cc);
     KGEnemyController ec = (KGEnemyController)cc;
     GameObject.Destroy(ec.transform.parent.gameObject);
 }
Exemple #12
0
 public override void begin(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController) cc;
     ec.m_SkeletonAnim.timeScale = 1.5f;
 }
Exemple #13
0
 public virtual void release(KGCharacterController releaser, AttackEffect ae)
 {
     transform.localScale = new Vector3(releaser.transform.localScale.x * Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z);
     m_attack = new Attack(releaser, ae, releaser.character.xDirection);
 }
Exemple #14
0
 public override void begin(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController)cc;
     ec.m_SkeletonAnim.loop = true;
     ec.m_SkeletonAnim.AnimationName = "idle";
 }
 public override void release(KGCharacterController releaser, AttackEffect ae)
 {
     skeletonAnim.AnimationName = ae.name;
     skeletonAnim.timeScale = ae.timeScale;
     m_attack = new Attack(releaser, ae, releaser.character.xDirection);
 }
Exemple #16
0
 public override void end(KGCharacterController cc)
 {
     zc.m_SkeletonAnim.state.Event -= OnEvent;
 }
Exemple #17
0
 public override void begin(KGCharacterController cc)
 {
     if(zc == null)zc = (ZakoFarController)cc;
     zc.m_SkeletonAnim.state.Event += OnEvent;
 }
Exemple #18
0
 public override void begin(KGCharacterController cc)
 {
     startFall = false;
 }
Exemple #19
0
 public Attack(KGCharacterController releaser, AttackEffect attackInfo, float direction)
 {
     m_Releaser = releaser;
     m_AttackEffect = attackInfo;
     this.direction = direction;
 }
Exemple #20
0
 public override void end(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController)cc;
     ec.m_SkeletonAnim.timeScale = 1.0f;
     base.end(cc);
 }
Exemple #21
0
 public override void begin(KGCharacterController cc)
 {
     base.begin(cc);
     KGEnemyController ec = (KGEnemyController)cc;
     ec.transform.parent.Find("Collider/HitCollider/body").GetComponent<CircleCollider2D>().enabled = false;
 }
Exemple #22
0
 public Attack(KGCharacterController releaser, AttackEffect attackInfo, int direction)
 {
     this.releaser = releaser;
     atkEffect = attackInfo;
     this.direction = direction;
 }
Exemple #23
0
 public override void execute(KGCharacterController cc)
 {
     if (cc.hitAttacks.Count != 0) ((KGEnemyController)cc).DoDamage();
     base.execute(cc);
 }
Exemple #24
0
 public override void execute(KGCharacterController cc)
 {
     if (cc.hitAttacks.Count != 0) {
         ((KGEnemyController)cc).hitAttackHandle();
     }
 }
Exemple #25
0
 public override void end(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController)cc;
     if(audioClip != null)ec.StopSound();
 }
Exemple #26
0
 public override void begin(KGCharacterController cc)
 {
     cc.StopRunningEffect();
 }
 public override void execute(KGCharacterController cc)
 {
     base.execute(cc);
 }