Exemplo n.º 1
0
 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 3
0
 public override void begin(KGCharacterController cc)
 {
     if (audioClip != null)
     {
         KGEnemyController ec = (KGEnemyController)cc;
         ec.PlaySound(audioClip);
     }
     base.begin(cc);
 }
Exemplo n.º 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));
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
 }
Exemplo n.º 7
0
 public virtual void end(KGCharacterController cc) { }
Exemplo n.º 8
0
 public virtual void begin(KGCharacterController cc)
 {
     startTime = Time.time;
 }
Exemplo n.º 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));
 }
Exemplo n.º 10
0
 public override void execute(KGCharacterController cc)
 {
     DefencableExecute(cc);
 }
Exemplo n.º 11
0
 public override void end(KGCharacterController cc)
 {
     base.end(cc);
     KGEnemyController ec = (KGEnemyController)cc;
     GameObject.Destroy(ec.transform.parent.gameObject);
 }
Exemplo n.º 12
0
 public override void begin(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController) cc;
     ec.m_SkeletonAnim.timeScale = 1.5f;
 }
Exemplo n.º 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);
 }
Exemplo n.º 14
0
 public override void begin(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController)cc;
     ec.m_SkeletonAnim.loop = true;
     ec.m_SkeletonAnim.AnimationName = "idle";
 }
Exemplo n.º 15
0
 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);
 }
Exemplo n.º 16
0
 public override void end(KGCharacterController cc)
 {
     zc.m_SkeletonAnim.state.Event -= OnEvent;
 }
Exemplo n.º 17
0
 public override void begin(KGCharacterController cc)
 {
     if(zc == null)zc = (ZakoFarController)cc;
     zc.m_SkeletonAnim.state.Event += OnEvent;
 }
Exemplo n.º 18
0
 public override void begin(KGCharacterController cc)
 {
     startFall = false;
 }
Exemplo n.º 19
0
 public Attack(KGCharacterController releaser, AttackEffect attackInfo, float direction)
 {
     m_Releaser = releaser;
     m_AttackEffect = attackInfo;
     this.direction = direction;
 }
Exemplo n.º 20
0
 public override void end(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController)cc;
     ec.m_SkeletonAnim.timeScale = 1.0f;
     base.end(cc);
 }
Exemplo n.º 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;
 }
Exemplo n.º 22
0
 public Attack(KGCharacterController releaser, AttackEffect attackInfo, int direction)
 {
     this.releaser = releaser;
     atkEffect = attackInfo;
     this.direction = direction;
 }
Exemplo n.º 23
0
 public override void execute(KGCharacterController cc)
 {
     if (cc.hitAttacks.Count != 0) ((KGEnemyController)cc).DoDamage();
     base.execute(cc);
 }
Exemplo n.º 24
0
 public override void execute(KGCharacterController cc)
 {
     if (cc.hitAttacks.Count != 0) {
         ((KGEnemyController)cc).hitAttackHandle();
     }
 }
Exemplo n.º 25
0
 public override void end(KGCharacterController cc)
 {
     KGEnemyController ec = (KGEnemyController)cc;
     if(audioClip != null)ec.StopSound();
 }
Exemplo n.º 26
0
 public override void begin(KGCharacterController cc)
 {
     cc.StopRunningEffect();
 }
Exemplo n.º 27
0
 public override void execute(KGCharacterController cc)
 {
     base.execute(cc);
 }