protected override void DoInit() { base.DoInit(); if (null == moveGuid) { moveGuid = GetComponentInChildren <EdgeCollider2D> (); } if (null == rigid) { rigid = GetComponent <Rigidbody2D> (); } if (null == collid2d) { collid2d = GetComponent <Collider2D> (); } rigid.isKinematic = true; collid2d.isTrigger = true; tracer = new XYTracerGuidMoveController(); tracer.transform = transform; tracer.guid = moveGuid; tracer.moveSpeed = moveSpeed; tracer.ReachPointEvent += Tracer_ReachPointEvent; tracer.FlipingEvent += Tracer_FlipingEvent; tracer.ReachTargetEvent += Tracer_ReachTargetEvent; tracer.excludesIndex = jumpIndexs; animStare.loopCount = 1; animStare.OnAnimateEvent += OnAnimateEventDelegate; Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.enemy); }
protected override void DoInit() { base.DoInit(); if (null == animWaggle) { animWaggle = GetComponent <SpriteAnimator> (); } Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.enemy); }
protected override void DoInit() { base.DoInit(); if (null == flyGuid) { flyGuid = GetComponentInChildren <EdgeCollider2D> (); } flyGuid.isTrigger = true; _cor = StartCoroutine(DoMyUpdate()); Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.enemy); }
protected override void DoInit() { base.DoInit(); _timer = new SwitchTimer(); tongueGuid = GetComponentInChildren <EdgeCollider2D> (); tongueGuid.enabled = false; Vector2DUtils.ChangePositionZ(transform.parent, (float)ZIndexs.enemy); edgeCollider = gameObject.AddComponent <EdgeCollider2D> (); edgeCollider.isTrigger = true; }
protected override void DoInit() { base.DoInit(); _rigid = GetComponent <Rigidbody2D> (); _rigid.isKinematic = true; _collid = GetComponent <Collider2D> (); _collid.isTrigger = true; Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.o4); _shakeEffect = GetComponent <ShakeEffect> (); // _shakeEffect.autoStart = false; }
protected override void DoInit() { base.DoInit(); if (crashSpeed <= 0f) { crashSpeed = Constants.o3_crash_speed; } extraLines = GetComponentsInChildren <EdgeCollider2D> (); _circleCollider = GetComponent <CircleCollider2D> (); _circleCollider.isTrigger = true; Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.o3); }
protected override void DoInit() { base.DoInit(); if (null == rotateCenter) { rotateCenter = GameObjectUtils.FindAnyOne(this.gameObject, "rotateCenter").transform; } if (null == board) { board = GameObjectUtils.FindAnyOne(this.gameObject, "board").transform; } Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.enemy); }
protected override void DoInit() { const int total = 3; sprites = new System.Collections.Generic.List <UnityEngine.Sprite> (total); for (int i = 0; i < total; i++) { Sprite sp = Resources.Load <Sprite> (string.Format("Img/O2-{0}", i + 1)); sprites.Add(sp); } base.DoInit(); Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.o2); }
protected override void DoInit() { base.DoInit(); if (null == moveGuid) { moveGuid = GetComponentInChildren <EdgeCollider2D> (); } if (null == collid2d) { collid2d = GetComponent <Collider2D> (); } collid2d.isTrigger = true; tracer = new XYTracerGuidMoveController(); tracer.xAxis = false; tracer.transform = transform; tracer.guid = moveGuid; tracer.moveSpeed = moveSpeed; tracer.ReachPointEvent += Tracer_ReachPointEvent; tracer.FlipingEvent += Tracer_FlipingEvent; tracer.ReachTargetEvent += Tracer_ReachTargetEvent; tracer.excludesIndex = jumpIndexs; animAttack.loopCount = 1; animAttack.OnAnimateEvent += OnAnimateEventDelegate; Vector2DUtils.ChangePositionZ(transform.parent, (float)ZIndexs.enemy9Group); animIdle.loopCount = 0; animIdle.playOnStart = true; animIdle.OnAnimateEvent += OnAnimateEventDelegate; animActive.loopCount = 1; animActive.playOnStart = false; animActive.OnAnimateEvent += OnAnimateEventDelegate; animClimb.loopCount = 0; animClimb.playOnStart = false; }
protected override void DoInit() { base.DoInit(); if (null == moveGuid) { moveGuid = GetComponentInChildren <EdgeCollider2D> (); } if (null == collid2d) { collid2d = GetComponent <Collider2D> (); } collid2d.isTrigger = true; tracer = new XYTracerGuidMoveController(); tracer.transform = transform; tracer.guid = moveGuid; tracer.moveSpeed = moveSpeed; tracer.ReachPointEvent += Tracer_ReachPointEvent; tracer.FlipingEvent += Tracer_FlipingEvent; tracer.excludesIndex = jumpIndexs; Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.enemy); }
protected override void DoInit() { base.DoInit(); if (null == moveGuid) { moveGuid = GetComponentInChildren <EdgeCollider2D> (); } if (null == collid2d) { collid2d = GetComponent <Collider2D> (); } collid2d.isTrigger = true; originalErulers = transform.eulerAngles; tracer = new XYTracerGuidMoveController(); tracer.xAxis = false; // tracer.traceInterval = 0f; tracer.transform = transform; tracer.guid = moveGuid; tracer.moveSpeed = moveSpeed; tracer.onlyFlipWhenReachPoint = true; tracer.ReachPointEvent += Tracer_ReachPointEvent; tracer.FlipingEvent += Tracer_FlipingEvent; tracer.ReachTargetEvent += Tracer_ReachTargetEvent; Vector2DUtils.ChangePositionZ(transform.parent, (float)ZIndexs.enemy); foreach (SpriteAnimator item in animIdles) { item.loopCount = 1; item.playOnStart = false; item.OnAnimateEvent += OnAnimateEventDelegate; } activeIdleAnimate = RandomIdleAnimate(); }
protected override void DoInit() { base.DoInit(); Vector2DUtils.ChangePositionZ(transform, (float)ZIndexs.e4nest); }