Beispiel #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            UITween t = target as UITween;

            if (!t)
            {
                return;
            }
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (t.isPlaying && GUILayout.Button("Stop", GUILayout.Width(100)))
            {
                t.Stop();
            }
            if (!t.isPlaying && GUILayout.Button("Play", GUILayout.Width(100)))
            {
                t.Play();
            }
            if (!t.isPlaying && GUILayout.Button("Restore", GUILayout.Width(100)))
            {
                t.Restore();
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }
Beispiel #2
0
 public void ClickHelpExit()
 {
     AudioManager.PlaySound(8);
     UITween.helpSectionActive(false);
     UITween.optionsMenuActive(true);
     UITween.btnSoundsActive(true);
 }
Beispiel #3
0
    //Mutes/Unmutes sounds.
    public void ClickSounds()
    {
        AudioManager.MuteSound();
        UITween.imgSoundsChangeSprite(AudioManager.IsMute());

        Debug.Log("Is Muted: " + AudioManager.IsMute());
    }
Beispiel #4
0
    static int set_onFinish(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UITween          obj       = (UITween)o;
            UITween.OnFinish arg0      = null;
            LuaTypes         funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (UITween.OnFinish)ToLua.CheckObject(L, 2, typeof(UITween.OnFinish));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(UITween.OnFinish), func) as UITween.OnFinish;
            }

            obj.onFinish = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onFinish on a nil value" : e.Message));
        }
    }
Beispiel #5
0
 public void ClickLevelsExit()
 {
     AudioManager.PlaySound(8);
     UITween.levelsActive(true);
     UITween.rctfMapSlide(-500f, 0f);
     UITween.levelsSlideIn();
     UITween.optionsActive(false);
 }
Beispiel #6
0
 public void ClickMenu()
 {
     AudioManager.PlaySound(7);
     UITween.menuActive(true);
     UITween.rctfMapSlide(-500f, 0f);
     UITween.menuSlideIn();
     UITween.optionsActive(false);
 }
    public static void OpenMenu(int menuIndex)
    {
        SetPause_Static(true);
        UITween menu = instance.menus[menuIndex];

        menu.Enable();
        currentlyOpenUI = menu;
    }
Beispiel #8
0
        public UILayer(Microsoft.Xna.Framework.Game G)
        {
            fpsStopwatch = new Stopwatch();
            fpsStopwatch.Start();

            m_G = G;

            m_WorldMatrix      = Matrix.Identity;
            m_ViewMatrix       = Matrix.CreateLookAt(Vector3.Right * 5, Vector3.Zero, Vector3.Forward);
            m_ProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.Pi / 4.0f,
                                                                     (float)GraphicsDevice.PresentationParameters.BackBufferWidth /
                                                                     (float)GraphicsDevice.PresentationParameters.BackBufferHeight,
                                                                     1.0f, 100.0f);

            TextStyle.DefaultTitle = new TextStyle {
                Font              = GameFacade.MainFont,
                VFont             = GameFacade.VectorFont,
                Size              = 10,
                Color             = new Color(255, 249, 157),
                SelectedColor     = new Color(0x00, 0x38, 0x7B),
                SelectionBoxColor = new Color(255, 249, 157)
            };

            TextStyle.DefaultButton = new TextStyle
            {
                Font              = GameFacade.MainFont,
                VFont             = GameFacade.VectorFont,
                Size              = 10,
                Color             = new Color(255, 249, 157),
                SelectedColor     = new Color(0x00, 0x38, 0x7B),
                SelectionBoxColor = new Color(255, 249, 157)
            };

            TextStyle.DefaultLabel = new TextStyle
            {
                Font              = GameFacade.MainFont,
                VFont             = GameFacade.VectorFont,
                Size              = 10,
                Color             = new Color(255, 249, 157),
                SelectedColor     = new Color(0x00, 0x38, 0x7B),
                SelectionBoxColor = new Color(255, 249, 157)
            };

            Tween = new UITween();
            this.AddProcess(Tween);

            inputManager = new InputManager();
            inputManager.RequireWindowFocus = true;
            mainUI          = new UIContainer();
            dialogContainer = new UIContainer();
            mainUI.Add(dialogContainer);

            // Create a new SpriteBatch, which can be used to draw textures.
            SpriteBatch = new UISpriteBatch(GraphicsDevice, 0);
            //GameFacade.OnContentLoaderReady += new BasicEventHandler(GameFacade_OnContentLoaderReady);
            m_G.GraphicsDevice.DeviceReset += new EventHandler <EventArgs>(GraphicsDevice_DeviceReset);
        }
Beispiel #9
0
 public void ClickGameExit(int soundID)
 {
     AudioManager.PlaySound(soundID);
     UITween.gameActive(true);
     UITween.rctfMapSlide(-500f, 0f);
     UITween.gameSlideIn();
     UITween.optionsActive(false);
     GameManager.SetPlayerPause(false);
 }
Beispiel #10
0
 public static void CloseMenu()
 {
     if (currentlyOpenUI)
     {
         currentlyOpenUI.Disable();
         currentlyOpenUI = null;
         SetPause_Static(false);
     }
 }
Beispiel #11
0
 //Loads the room based on roomID.
 public void ClickButtonRoom(int roomID)
 {
     AudioManager.PlaySound(7);
     UITween.gameActive(true);
     UITween.levelsSlideOut();
     UITween.gameSlideIn();
     UITween.levelsActive(false);
     RoomManager.LoadRoom(roomID);
 }
Beispiel #12
0
        public UILayer(Microsoft.Xna.Framework.Game G, SpriteFont SprFontBig, SpriteFont SprFontSmall)
        {
            m_G            = G;
            m_SprFontBig   = SprFontBig;
            m_SprFontSmall = SprFontSmall;

            GraphicsDevice.VertexDeclaration = new VertexDeclaration(GraphicsDevice,
                                                                     VertexPositionNormalTexture.VertexElements);

            m_WorldMatrix      = Matrix.Identity;
            m_ViewMatrix       = Matrix.CreateLookAt(Vector3.Right * 5, Vector3.Zero, Vector3.Forward);
            m_ProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.Pi / 4.0f,
                                                                     (float)GraphicsDevice.PresentationParameters.BackBufferWidth /
                                                                     (float)GraphicsDevice.PresentationParameters.BackBufferHeight,
                                                                     1.0f, 100.0f);

            TextStyle.DefaultTitle = new TextStyle {
                Font              = GameFacade.MainFont,
                Size              = 10,
                Color             = new Color(255, 249, 157),
                SelectedColor     = new Color(0x00, 0x38, 0x7B),
                SelectionBoxColor = new Color(255, 249, 157)
            };

            TextStyle.DefaultButton = new TextStyle
            {
                Font              = GameFacade.MainFont,
                Size              = 10,
                Color             = new Color(255, 249, 157),
                SelectedColor     = new Color(0x00, 0x38, 0x7B),
                SelectionBoxColor = new Color(255, 249, 157)
            };

            TextStyle.DefaultLabel = new TextStyle
            {
                Font              = GameFacade.MainFont,
                Size              = 10,
                Color             = new Color(255, 249, 157),
                SelectedColor     = new Color(0x00, 0x38, 0x7B),
                SelectionBoxColor = new Color(255, 249, 157)
            };

            Tween = new UITween();
            this.AddProcess(Tween);

            inputManager    = new InputManager();
            mainUI          = new UIContainer();
            dialogContainer = new UIContainer();
            mainUI.Add(dialogContainer);

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new UISpriteBatch(GraphicsDevice, 3);

            GameFacade.OnContentLoaderReady += new BasicEventHandler(GameFacade_OnContentLoaderReady);
            m_G.GraphicsDevice.DeviceReset  += new EventHandler(GraphicsDevice_DeviceReset);
        }
Beispiel #13
0
 public void ClickLeave()
 {
     AudioManager.PlaySound(7);
     SaveData.SaveGameData();
     RoomManager.LoadRoom(RoomManager.GetMainMenuIndex());
     UITween.levelsActive(true);
     UITween.rctfMapSlide(-500f, 0f);
     UITween.levelsSlideIn();
     UITween.optionsActive(false);
 }
Beispiel #14
0
 private void Update()
 {
     //Press Space
     if (ControllerManager.GetSpaceDown() && UITween.IsMenuActive())
     {
         AudioManager.PlaySound(6);
         UITween.levelsActive(true);
         UITween.menuSlideOut();
         UITween.levelsSlideIn();
         UITween.menuActive(false);
     }
 }
Beispiel #15
0
    //Set the UI's txtScore.
    public static void UpdateTextScore(int score)
    {
        if (score < 0)
        {
            return;
        }

        else
        {
            UITween.UpdateTextScore(score);
        }
    }
Beispiel #16
0
    void Start()
    {
        inst = this;
        UITween[] tweens = GameObject.FindObjectsOfType <UITween>();
        foreach (UITween panel in tweens)
        {
            panels.Add(panel.name, panel);
        }

        tutpanel     = panels["Tutorial"];
        tutPanelText = tutpanel.transform.GetChild(0).GetComponent <Text>();
    }
Beispiel #17
0
    public void ClickWarrantExit()
    {
        //Slides the map down.
        AudioManager.PlaySound(8);
        GameManager.ResetScore();
        UITween.rctfMapSlide(-500f, 0);

        //Go to the credits scene.
        RoomManager.LoadRoom(RoomManager.GetCreditsIndex());
        UITween.optionsActive(false);
        UITween.LoadingCredits(2f);
        GameManager.SetPlayerPause(false);
    }
 private bool IsAnimationSetted()
 {
     if (tweenScript == null)
     {
         tweenScript = GetComponent <UITween>();
         if (tweenScript == null)
         {
             Debug.LogError("Easy Tween 2.0 not referenced");
             return(false);
         }
     }
     return(true);
 }
Beispiel #19
0
    //Slides out the rctfTransition + unfade the cnvgPanel.
    public static void CloseTransition()
    {
        if (INSTANCE == null)
        {
            return;
        }

        UITween.transitionActive(true);
        UITween.cnvgPanelFade(1, 0.5f);
        AudioManager.PlaySound(9);
        UITween.rctfTransitionSlide(0, 0);
        UITween.gameActive(false);
    }
Beispiel #20
0
        /**
         * Hides the view with animations
         */
        void HideWithAnimations(System.Action cb)
        {
            //var imageBehindIcon_tf = this.imageBehindIcon.GetComponent<RectTransform> ();

            float fadeTextDur = 0.2f;

            UITween.startAlphaAnimation(textCaption, 1f, 0f, fadeTextDur, 0.25f, Tween.TweenTypes.easeInOutExpo, () => {
                textCaption.gameObject.SetActive(false);
            });

            //fadeTextOff += fadeTextDur / 2f;
            UITween.startAlphaAnimation(textDesc, 1f, 0f, fadeTextDur, 0.25f, Tween.TweenTypes.easeInOutExpo, () => {
                textDesc.gameObject.SetActive(false);
            });

            UITween.startAlphaAnimation(textPrice, 1f, 0f, fadeTextDur, 0.25f, Tween.TweenTypes.easeInOutExpo, () => {
            });


            UITween.startAlphaAnimation(buttonOkay.GetComponent <UnityEngine.UI.Graphic>(), 1f, 0f, fadeTextDur, 0f, Tween.TweenTypes.easeInOutExpo, () => {
                buttonOkay.gameObject.SetActive(false);
            });

            UITween.startAlphaAnimation(buttonCancel.gameObject, 1f, 0f, fadeTextDur, 0f, Tween.TweenTypes.easeInOutExpo, () => {
                buttonCancel.gameObject.SetActive(false);
            });

            //
            UITween.startScaleAnimation(this.imageBehindIcon, 1f, 0f, 0.5f, 0.4f + 0.0f, Tween.TweenTypes.easeOutBounce);
            UITween.startAlphaAnimation(this.imageBehindIcon, 1f, 0f, 0.25f, 0.4f + 0.25f, Tween.TweenTypes.easeInExpo, () => { });
            UITween.startScaleAnimation(this.backgroundImage, 1f, 0f, 0.5f, 0.0f, Tween.TweenTypes.easeInExpo, () => { });

            // Fade away the white background of the dialogue.
            UITween.StartAnimateValue(dialogBG, 1f, 0f, 0.5f, 0.5f, Tween.TweenTypes.Linear, () => {
                var c          = dialogBG.color;
                c.a            = 1.0f;
                dialogBG.color = c;
                dialogBG.SetAllDirty();
            }, ( float value) => {
                var c          = dialogBG.color;
                c.a            = value;
                dialogBG.color = c;
                dialogBG.SetAllDirty();
            }, () => {
                var c          = dialogBG.color;
                c.a            = 0f;
                dialogBG.color = c;
                dialogBG.SetAllDirty();
                cb();
            });
        }
Beispiel #21
0
 static int ToInit(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UITween obj = (UITween)ToLua.CheckObject(L, 1, typeof(UITween));
         obj.ToInit();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #22
0
 static int IsPlaying(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UITween obj = (UITween)ToLua.CheckObject(L, 1, typeof(UITween));
         bool    o   = obj.IsPlaying();
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #23
0
 static int Play(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UITween obj  = (UITween)ToLua.CheckObject(L, 1, typeof(UITween));
         bool    arg0 = LuaDLL.luaL_checkboolean(L, 2);
         obj.Play(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #24
0
    public void ClickMenuMiniMap()
    {
        AudioManager.PlaySound(7);
        UITween.optionsActive(true);
        UITween.optionsMenuActive(true);
        UITween.btnSoundsActive(true);

        UITween.helpSectionActive(false);
        UITween.optionsLevelsActive(false);
        UITween.optionsGameActive(false);
        UITween.warrantSectionActive(false);

        UITween.menuSlideOut();
        UITween.rctfMapSlide(0, 1);
        UITween.menuActive(false);
    }
Beispiel #25
0
    public static void TriggerWarrant()
    {
        UITween.optionsActive(true);
        UITween.warrantSectionActive(true);

        UITween.btnSoundsActive(false);
        UITween.optionsMenuActive(false);
        UITween.helpSectionActive(false);
        UITween.optionsLevelsActive(false);
        UITween.optionsGameActive(false);

        UITween.gameSlideOut();
        UITween.rctfMapSlide(0, 1);
        UITween.gameActive(false);
        GameManager.SetPlayerPause(true);
    }
Beispiel #26
0
    static int set_loopType(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UITween obj = (UITween)o;
            DG.Tweening.LoopType arg0 = (DG.Tweening.LoopType)ToLua.CheckObject(L, 2, typeof(DG.Tweening.LoopType));
            obj.loopType = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index loopType on a nil value" : e.Message));
        }
    }
Beispiel #27
0
    static int set_playOnStart(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UITween obj  = (UITween)o;
            bool    arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.playOnStart = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index playOnStart on a nil value" : e.Message));
        }
    }
Beispiel #28
0
    static int get_onFinish(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UITween          obj = (UITween)o;
            UITween.OnFinish ret = obj.onFinish;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onFinish on a nil value" : e.Message));
        }
    }
Beispiel #29
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        UITween script = (UITween)target;

        if (GUILayout.Button("Set Start"))
        {
            script.moveFrom = script.gameObject.transform.position;
        }
        if (GUILayout.Button("Set End"))
        {
            script.moveTo = script.gameObject.transform.position;
        }

        DrawDefaultInspector();
    }
Beispiel #30
0
    static int set_delay(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UITween obj  = (UITween)o;
            float   arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.delay = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index delay on a nil value" : e.Message));
        }
    }