// Use this for initialization void Start() { hardwareButtonHandler = this.GetComponentInChildren <HardwareButtonsHandler>(); hardwareButtonHandler.AddEventListener(this.gameObject); exitButtonsContainer = this.transform.Find("ExitButtonsContainer"); fadingBackground = exitButtonsContainer.transform.Find("Background").GetComponent <Fading2D>(); originalColor = fadingBackground.GetComponent <SpriteRenderer>().color; exitButtonsContainer.GetComponentInChildren <YesButton>().AddEventListener(this.gameObject); exitButtonsContainer.GetComponentInChildren <NoButton>().AddEventListener(this.gameObject); exitButtonsContainer.active = false; }
public virtual void OnStart() { originalColor = spriteToUse.color; fadeComponent = this.GetComponent <Fading2D>(); fadeComponent.SetTarget(spriteToUse); fadeComponent.AddEventListener(this.gameObject); if (!isInitialized) { clouds = new List <Cloud>(this.GetComponentsInChildren <Cloud>()); isInitialized = true; } Before(); }
protected override void Initialize() { if (!isInitialized) { this.spriteRenderer = this.GetComponent <SpriteRenderer>(); this.goalPosition = goalTransform.localPosition; MoveToGoal(); fadeComponent = this.GetComponent <Fading2D>(); if (this.spriteRenderer) { cloudOriginalColor = this.spriteRenderer.color; } isInitialized = true; } }
// Use this for initialization void Start() { fading2D = this.GetComponent <Fading2D>(); fading2D.FadeInto(targetColor, 50f); }