public static tk2dBaseSprite GetAnySprite(this BraveBehaviour b) { return (b.GetComponent <tk2dBaseSprite>() ?? b.transform.GetComponentInChildren <tk2dBaseSprite>() ?? b.transform.GetComponentInParent <tk2dBaseSprite>()); }
private static void ResetToIdle(BraveBehaviour idler) { SpriteOutlineManager.RemoveOutlineFromSprite(idler.sprite, true); SpriteOutlineManager.AddOutlineToSprite(idler.sprite, Color.black); //var idle = idler.GetComponent<CharacterSelectIdleDoer>().coreIdleAnimation; //idler.sprite.SetSprite(idler.spriteAnimator.GetClipByName(idle).frames[0].spriteId); //idler.talkDoer.OnExitRange(null); }
private static void HandleSprites(BraveBehaviour selectCharacter, BraveBehaviour player) { selectCharacter.spriteAnimator.Library = player.spriteAnimator.Library; selectCharacter.sprite.Collection = player.sprite.Collection; selectCharacter.renderer.material = new Material(selectCharacter.renderer.material); selectCharacter.sprite.ForceBuild(); var idle = selectCharacter.GetComponent <CharacterSelectIdleDoer>().coreIdleAnimation; selectCharacter.spriteAnimator.Play(idle); }
private static void HandleSprites(BraveBehaviour selectCharacter, BraveBehaviour player) { selectCharacter.spriteAnimator.Library = player.spriteAnimator.Library; selectCharacter.sprite.Collection = player.sprite.Collection; selectCharacter.renderer.material = new Material(selectCharacter.renderer.material); //BotsMod.BotsModule.Log($"{selectCharacter.spriteAnimator.gameObject}"); selectCharacter.sprite.ForceBuild(); string coreIdleAnimation = selectCharacter.GetComponent <CharacterSelectIdleDoer>().coreIdleAnimation; selectCharacter.spriteAnimator.Play(coreIdleAnimation); }
public void Start() { parent = GetComponent <BraveBehaviour>(); bar = new SGroup() { Size = new Vector2(50, 10), With = { new HealthbarFix(parent) }, Border = 2f }; parent.healthHaver.OnDeath += OnDeath; parent.healthHaver.OnHealthChanged += OnHealthChanged; lastHealth = parent.healthHaver.GetCurrentHealth(); }
public HealthBar(BraveBehaviour parent) { m_parent = parent; m_HealthHaver = m_parent.healthHaver; }