static public SpriteRenderPair CreateRenderPair(GameObject _gameObject, Sprite _s, float _positionOnScreen) { SpriteRenderPair srp = new SpriteRenderPair(); srp.ChildObject = new GameObject(_s.name + "Renderer"); srp.SpriteRenderer = srp.ChildObject.AddComponent <SpriteRenderer>() as SpriteRenderer; srp.Sprite = _s; srp.ChildObject.transform.SetParent(_gameObject.transform); srp.ChildObject.transform.localPosition = new Vector3(0, _positionOnScreen, -0.1f); return(srp); }
public SpriteList(GameplayRenderer _gameplayRenderer) { SplashSprites = new List <SpriteRenderPair>(); float ScreenTop = 3; float ScreenMiddle = 0; float ScreenBottom = -3; TXT_1 = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_1, ScreenMiddle); TXT_2 = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_2, ScreenMiddle); TXT_3 = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_3, ScreenMiddle); TXT_Foozies = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Foozies, ScreenMiddle); TXT_Counterhit = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Counterhit, ScreenBottom); TXT_Draw = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Draw, ScreenMiddle); TXT_Player1 = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Player1, ScreenTop); TXT_Player2 = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Player2, ScreenTop); TXT_Shimmy = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Shimmy, ScreenBottom); TXT_StrayHit = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_StrayHit, ScreenBottom); TXT_Win = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Win, ScreenMiddle); TXT_WhiffPunish = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_WhiffPunish, ScreenBottom); TXT_Trade = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Trade, ScreenBottom); TXT_Timeout = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Timeout, ScreenBottom); TXT_Throw = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Throw, ScreenBottom); TXT_GameOver = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_GameOver, ScreenTop); TXT_AnyButton = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_AnyButton, ScreenBottom); TXT_Feet = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Feet, ScreenBottom); TXT_Punish = SpriteRenderPair.CreateRenderPair(_gameplayRenderer.gameObject, _gameplayRenderer.TXT_Punish, ScreenBottom); SplashSprites.Add(TXT_1); SplashSprites.Add(TXT_2); SplashSprites.Add(TXT_3); SplashSprites.Add(TXT_Foozies); SplashSprites.Add(TXT_Counterhit); SplashSprites.Add(TXT_Draw); SplashSprites.Add(TXT_Player1); SplashSprites.Add(TXT_Player2); SplashSprites.Add(TXT_Shimmy); SplashSprites.Add(TXT_StrayHit); SplashSprites.Add(TXT_Win); SplashSprites.Add(TXT_WhiffPunish); SplashSprites.Add(TXT_Trade); SplashSprites.Add(TXT_Timeout); SplashSprites.Add(TXT_Throw); SplashSprites.Add(TXT_GameOver); SplashSprites.Add(TXT_AnyButton); SplashSprites.Add(TXT_Feet); SplashSprites.Add(TXT_Punish); }