예제 #1
0
        // ********************************
        // Awake
        // ********************************
        protected override void Awake()
        {
            base.Awake();

            // On button sprite
            OnButton = new GameObject("On Button Sprite");
            OnButton.transform.SetParent(this.transform);
            OnButton.transform.localPosition = OnButtonPosition;
            OnButton.transform.localScale    = ButtonScale;
            OnButtonSprite                = OnButton.AddComponent <SpriteRenderer>();
            OnButtonSprite.sprite         = GlowSprite;
            OnButtonSprite.sharedMaterial = ModAPI.FindMaterial("VeryBright");
            OnButtonSprite.color          = OnButtonColour;
            OnButtonSprite.enabled        = false;

            // On button light
            OnButtonLight            = ModAPI.CreateLight(transform, Color.red);
            OnButtonLight.Color      = OnButtonColour;
            OnButtonLight.Brightness = 10.0f;
            OnButtonLight.Radius     = 0.01f;
            OnButtonLight.transform.localPosition = OnButtonPosition;
            OnButtonLight.SpriteRenderer.enabled  = false;
        }