public ShadowEgo() { Transform .Create(this) .SetPosition(250, 250) .SetSpeed(150f / 0.375f) .SetOrientation(-Vector2.UnitX) .SetUpdateZWithPosition(true) .SetCalculateEffectiveSpeedFn(CalculateSpeed) .SetScale(0.5f); Sprite .Create(this) .SetEnableNormalMap(true) .SetImage("characters/ego/sprite", 9, 4); SpriteTransformAnimation .Create(this) .SetSetFrameFn(SetFrame); SpriteData .Create(this) .SetOrientationFlip(false) .SetOffset(-40, -310); Scripts .Create(this); Lightning .Create(this) .SetLightColor(new Vector3(1.5f, 0.25f, 0.25f)); Visible = true; Enabled = true; }
public Ego() { CameraLocked .Create(this); Transform .Create(this) .SetPosition(350, 250) .SetSpeed(150f / 0.375f) .SetOrientation(-Vector2.UnitX) .SetUpdateZWithPosition(true) .SetCalculateEffectiveSpeedFn(CalculateSpeed) .SetScale(0.24f); SpineSprite .Create(this) .SetImage("characters/ego/ego") .SetAnimationMixFn(SetAnimationMix) .SetOnSpineEvent(SpineEvent) .SetOnSpineAnimationEnd(SpineAnimationEnd); SpriteData .Create(this) .SetOrientationFlip(true); Scripts .Create(this); Lightning .Create(this) .SetLightColor(new Vector3(1.5f, 0.25f, 0.25f)); Visible = true; Enabled = true; }
void CreateLightning() { if (!newObjLightning) { newObjLightning = Instantiate(PrefabLightning); newObjLightning.transform.SetParent(ParentTransform); newObjLightning.transform.localPosition = Vector3.zero; newLightning = newObjLightning.GetComponent <Lightning>(); SetDefault(); newLightning.Create(TrStart.localPosition, TrEnd.localPosition); B_CreateLightning.interactable = false; } }
IEnumerator ChainReaction() { Stuff raiden = null; float distanceMin = float.MaxValue; foreach (var stuff in Factory.LIVE_STUFF) { if (stuff != null && stuff is CatRaiden) { float distance = DistanceTo(stuff); if (distance < distanceMin) { distanceMin = distance; raiden = stuff; } } } if (raiden != null) { Factory.LIVE_STUFF.Remove(raiden); Lightning.Create(raiden, this); } yield return(new WaitForSeconds(0.1f)); shape.enabled = false; //ShakeAndDestroy(); Destroy(rb); iTween.ScaleTo(gameObject, iTween.Hash("x", 0, "y", 0, "easeType", "easeInBack", "time", 0.3f)); Destroy(gameObject, 1f); Bomb(radius); if (raiden != null) { yield return(new WaitForSeconds(0.3f)); raiden.Activate(Vector2.zero); } }
public Ryan(Inventory inventory) { Inventory = inventory; CameraLocked .Create(this); Transform .Create(this) .SetPosition(350, 250) .SetSpeed(120) .SetOrientation(-Vector2.UnitY) .SetUpdateZWithPosition(true) .SetScale(1.0f); Sprite .Create(this) .SetEnableNormalMap(false) .SetImage(content.characters.ryan.sprite_blood, 13, 8, 0); SpriteTransformAnimation .Create(this) .SetSetFrameFn(SetFrame); SpriteCustomAnimation .Create(this) .SetGetFramesAction(GetCustomAnimationFrames); SpriteData .Create(this) .SetOrientationFlip(false) .SetOffset(-76, -143); Text .Create(this) .SetFont(content.fonts.pixeloperator_outline_BMF) .SetWidth(300) .SetConstrain(true) .SetConstrainingRectangle(new Rectangle(0, 0, Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT)) .SetAlign(Alignment.Bottom); Navigation .Create(this) .SetApplyScale(true) .SetApplyColoring(true) .SetRestrictPosition(true) .SetScale(1.75f); Scripts .Create(this); Lightning .Create(this) .SetLightPosition(new Vector3(new Vector2(51, 61), 0)) .SetLightColor(new Vector3(1.25f, 0.6f, 0.6f)); BloodDropEmitter .Create(this); Score .Create(this); RandomCountdown .Create(this) .SetDuration(7) .SetMinUpdates(300) .SetMaxUpdates(500); }