Exemplo n.º 1
0
    void OnDisable()
    {
        OnDisabled();

        if (hideSystemUIWhileEnabled)
        {
//			SystemUtility.ShowSystemUI( true );
            SystemUIEvent sys = SystemUIEvent.Instance;
            if (sys != null)
            {
                sys.ShowSystemUI(true);
            }
        }

        if (deactiveObjWhileShowing != null)
        {
            deactiveObjWhileShowing.SetActive(true);
        }

        if (m_IsSkip)
        {
            ViNoEventManager.Instance.TriggerEvent("OnClickSkip");
            ViNo.skip = false;
        }
    }
Exemplo n.º 2
0
    void OnEnable()
    {
        bool          findAndSet = false;
        SystemUIEvent sys        = target as SystemUIEvent;

        if (sys.messageBoxes == null)
        {
            findAndSet = true;
        }
        else
        {
            // If missing Component , then find and set.
            for (int i = 0; i < sys.messageBoxes.Length; i++)
            {
                if (sys.messageBoxes[i] == null)
                {
                    findAndSet = true;
                    break;
                }
            }
        }

        if (findAndSet)
        {
            FindAndSetMessageTargets();
        }
    }
Exemplo n.º 3
0
 public void CheckInstance()
 {
     if (m_Instance == null)
     {
         m_Instance = GameObject.FindObjectOfType(typeof(SystemUIEvent)) as SystemUIEvent;
     }
 }
Exemplo n.º 4
0
    IEnumerator DelayHideSystem(float afterSec)
    {
        yield return(new WaitForSeconds(afterSec));

        SystemUIEvent sys = SystemUIEvent.Instance;

        sys.HideSystemUI();
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void OnDisable()
    {
        SystemUIEvent sys = SystemUIEvent.Instance;

        if (sys != null)
        {
            sys.ShowSystemUI(true);
        }
//		SystemUtility.ShowSystemUI();
        ViNo.autoMode = m_TempAutoModeState;
    }
Exemplo n.º 6
0
    // Use this for initialization
    void OnEnable()
    {
//		SystemUtility.ShowSystemUI( false );
#if false
        SystemUIEvent sys = SystemUIEvent.Instance;
        sys.HideSystemUI();
#else
        StartCoroutine("DelayHideSystem", 0.1f);
#endif
        m_TempAutoModeState = ViNo.autoMode;
        ViNo.autoMode       = false;
    }
Exemplo n.º 7
0
    static public void ShowSystemUI(bool t = true)
    {
        SystemUIEvent sys = SystemUIEvent.Instance;

        if (sys != null)
        {
            sys.ShowSystemUI(t);
        }
        else
        {
            Debug.LogWarning("SystemUIEvent not found.");
        }
    }
Exemplo n.º 8
0
    static public void EnableColliderCurrentTextBox(bool enable)
    {
        SystemUIEvent sys = SystemUIEvent.Instance;

        if (sys != null)
        {
            sys.EnableColliderCurrentTextBox(enable);
        }
        else
        {
            Debug.LogWarning("SystemUIEvent not found.");
        }
    }
Exemplo n.º 9
0
    /// <summary>
    /// Save the specified info.
    /// </summary>
    /// <param name='info'>
    /// Info.
    /// </param>
    static public void Save(ViNoSaveInfo info)
    {
        info.data.m_LoadedLevelIndex = Application.loadedLevel;
        info.data.m_LoadedLevelName  = Application.loadedLevelName;

        // Serialization of Scene.
        if (ViNoSceneManager.Instance != null)
        {
            info.data.m_SceneXmlData = ViNoSceneManager.Instance.Save( );
        }

        // Serialization of VM.
        if (VM.Instance != null)
        {
            VM.SerializationInfo vmSerInfo = VM.Instance.Serialize( );
            info.data.m_NodeName            = vmSerInfo.m_NodeName;
            info.data.m_CurrentScenarioName = vmSerInfo.m_ScenarioName;
        }
        else
        {
            ViNoDebugger.LogError("SaveInfo", "VM NOT Found. Can't serialize VM Info.");
        }

        // Serialization of BGM.
        if (ISoundPlayer.Instance != null)
        {
            ISoundPlayer pl = ISoundPlayer.Instance;
//			ViNoSoundPlayer pl = ISoundPlayer.Instance as ViNoSoundPlayer;
            pl.OnSave(info.data);
        }

/*		if( ScenarioNode.Instance != null ){
 *                      info.data.m_ScenarioResourceFilePath = ScenarioNode.Instance.scenarioResourceFilePath;
 *              }
 * //*/

        // Set DateTime.
        info.data.m_Date = ViNoStringExtensions.GetDateTimeNowString();

        // Set Message.
        SystemUIEvent sys = GameObject.FindObjectOfType(typeof(SystemUIEvent)) as SystemUIEvent;
        string        str = sys.GetCurrentMessage();

        if (str.Length >= 14)
        {
            str = str.Substring(0, 14) + "...";
        }
        info.data.m_ScenarioDescription = str;
    }
Exemplo n.º 10
0
        /// /// <summary>
        /// Change the Color of Name Text by Actor Name.
        /// </summary>
        void OnSetText(MessageEventData data)
        {
//			string actorName = data.message;
            SystemUIEvent sys = SystemUIEvent.Instance;

            if (m_ActorMap.ContainsKey(data.message))
            {
                ActorInfo actorInfo = m_ActorMap[data.message];
                data.message = sys.GetBeginColorTag(actorInfo.textColor, data.textBoxID) + data.message + sys.GetEndColorTag(data.textBoxID);

                // Test...
                if (actorInfo.portrait != null && portraitMat1 != null)
                {
                    //	Debug.Log( "Actor Portrait : " );
                    portraitMat1.mainTexture = actorInfo.portrait;
                }
                else
                {
                    //	portraitMat1.gameObject.SetActive( false );
                }

                sys.SetText(data.message, data.textBoxID);
            }
            else
            {
                sys.SetText(data.message, data.textBoxID);
            }
            VM.Instance.UpdateMessageEvtData(data);

// Highlight Current Speaker for future update.
#if false
            if (highlightCurrentSpeaker)
            {
                if (prevSpeakerName == actorName)
                {
                    return;
                }

                if (!string.IsNullOrEmpty(prevSpeakerName))
                {
                    ViNoSceneManager.Instance.SetDeactiveColor(prevSpeakerName);
                }

                ViNoSceneManager.Instance.SetActiveColor(actorName);

                prevSpeakerName = actorName;
            }
#endif
        }
Exemplo n.º 11
0
    static public void ClearAllTextBoxMessage()
    {
        SystemUIEvent sys = SystemUIEvent.Instance;

        if (sys != null)
        {
            for (int i = 0; i < sys.messageBoxes.Length; i++)
            {
                sys.messageBoxes[i].ClearMessage();
            }
        }
        else
        {
            Debug.LogWarning("SystemUIEvent not found.");
        }
    }
Exemplo n.º 12
0
    // TODO /
    void resetfont(Hashtable param)
    {
        SystemUIEvent sys = SystemUIEvent.Instance;

        if (sys == null)
        {
            Debug.LogError("SystemUIEvent not found in this scene.");
            return;
        }

        // Commit Changes to Current Message Target.
        ViNoTextBox textBox = sys.GetCurrentTextBox();

        if (textBox != null)
        {
            textBox.ResetFont();
        }
    }
Exemplo n.º 13
0
    void OnEnable()
    {
        if (deactiveObjWhileShowing != null)
        {
            deactiveObjWhileShowing.SetActive(false);
        }

        if (hideSystemUIWhileEnabled)
        {
//			SystemUtility.ShowSystemUI( false );
            SystemUIEvent sys = SystemUIEvent.Instance;
            if (sys != null)
            {
                sys.HideSystemUI();
            }
        }
        m_IsSkip = ViNo.skip;

        OnEnabled();
    }
Exemplo n.º 14
0
    /// <summary>
    /// Finds the text box objects.
    /// </summary>
    public void FindTextBoxObjects( )
    {
        SystemUIEvent system = GameObject.FindObjectOfType(typeof(SystemUIEvent)) as SystemUIEvent;

        if (system != null)
        {
            m_NameTextBox = system.GetTextBoxBy(m_NameHndName);
            m_ViNoTextBox = system.GetTextBoxBy(m_DialogHndName);
        }
        else
        {
            GameObject nameTextObj = GameObject.Find(m_NameHndName);
            if (nameTextObj != null)
            {
                m_NameTextBox = nameTextObj.GetComponent <ViNoTextBox>();
            }

            GameObject textObj = GameObject.Find(m_DialogHndName);
            if (textObj != null)
            {
                m_ViNoTextBox = textObj.GetComponent <ViNoTextBox>();
            }
        }
    }
Exemplo n.º 15
0
 public void CheckInstance()
 {
     if( m_Instance == null ){
         m_Instance = GameObject.FindObjectOfType( typeof( SystemUIEvent )) as SystemUIEvent;
     }
 }
Exemplo n.º 16
0
    void FindAndSetMessageTargets()
    {
        SystemUIEvent sys = target as SystemUIEvent;

        sys.messageBoxes = GameObject.FindObjectsOfType(typeof(ViNoTextBox)) as ViNoTextBox[];
    }
Exemplo n.º 17
0
    public void OnHideMessage(MessageEventData data)
    {
        SystemUIEvent sys = SystemUIEvent.Instance;

        sys.HideMessage(data);
    }
Exemplo n.º 18
0
// Platform StandAlone Key Input.
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER
    // Update is called once per frame
    void Update()
    {
        SystemUIEvent sys = SystemUIEvent.Instance;

        if (sys != null)
        {
            ISelectionsCtrl sel = ISelectionsCtrl.Instance;
            if (sel != null && sel.IsActive())
            {
                return;
            }

            // Handle Keyboard.
            if (useKeyboard)
            {
                if (Input.GetKeyDown(KeyCode.Return))
                {
                    if (sys.IsActiveCurrentMessageTarget())
                    {
                        ViNoAPI.NextMessage();
                    }
                }

                if (Input.GetKeyDown(KeyCode.Escape))
                {
                    if (sys.IsActiveBackLog())
                    {
                        ViNoEventManager.Instance.TriggerEvent("ToggleActiveBackLog");
                    }
                    else if (sys.IsActiveConfig())
                    {
                        ViNoEventManager.Instance.TriggerEvent("ToggleActiveConfig");
                    }
                    else if (sys.IsActiveSaveLoadPanel())
                    {
                        ViNoEventManager.Instance.TriggerEvent("ToggleActiveSaveLoadPanel");
                    }
                    else
                    {
                        ViNoEventManager.Instance.TriggerEvent("ToggleActiveMenuPanel");
                    }
                }

                if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    ViNoEventManager.Instance.TriggerEvent("OnClickBackLog");
                }
                else if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    if (sys.IsActiveCurrentMessageTarget())
                    {
                        ViNoAPI.NextMessage();
//						ViNoEventManager.Instance.TriggerEvent( "ToggleActiveSaveLoadPanel" );
                    }
                }

                // Menu is Activated.
                bool isActiveMenuPanel = sys.IsActiveMenuPanel();
                if (isActiveMenuPanel)
                {
                    if (Input.GetKeyDown(KeyCode.S))
                    {
                        ViNoEventManager.Instance.TriggerEvent("OnClickSave");
                    }
                    else if (Input.GetKeyDown(KeyCode.L))
                    {
                        ViNoEventManager.Instance.TriggerEvent("OnClickLoad");
                    }
                    else if (Input.GetKeyDown(KeyCode.P))
                    {
                        ViNoEventManager.Instance.TriggerEvent("ToggleActiveConfig");
                    }
                }
                // Normal.
                else
                {
                    if (Input.GetKeyDown(KeyCode.S))
                    {
                        ViNoEventManager.Instance.TriggerEvent("ShowSavePanel");
                    }
                    else if (Input.GetKeyDown(KeyCode.L))
                    {
//						ViNoEventManager.Instance.TriggerEvent( "OnClickLoad" );
                        ViNoEventManager.Instance.TriggerEvent("ShowLoadPanel");
                    }
                    else if (Input.GetKeyDown(KeyCode.A))
                    {
                        ViNoEventManager.Instance.TriggerEvent("OnClickAuto");
                    }

/*					else if( Input.GetKeyDown( KeyCode.S ) ){
 *                                              ViNoEventManager.Instance.TriggerEvent( "OnClickSkip" );
 *                                      }
 *                                      else if( Input.GetKeyDown( KeyCode.L ) ){
 *                                              ViNoEventManager.Instance.TriggerEvent( "ToggleActiveBackLog" );
 *                                      }
 * //*/
                }

                if (Input.GetKeyDown(KeyCode.Space) ||
                    Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    bool t = sys.IsActiveSystemUI( );
                    sys.ShowSystemUI(!t);
                }
            }

            // Handle Mouse Wheel.
            if (useMouseWheelScroll)
            {
                float scroll = Input.GetAxis("Mouse ScrollWheel");

                bool isActiveSystem = sys.IsActiveSystemUI( );

                // Wheel Up and show BackLog.
                if (isActiveSystem && scroll > 0)
                {
                    ViNoEventManager.Instance.TriggerEvent("OnClickBackLog");
                }
                // Wheel Down and Next Message.
                else if (scroll < 0)
                {
                    if (isActiveSystem && sys.IsActiveCurrentMessageTarget())
                    {
                        ViNoAPI.NextMessage();
                    }
                }
            }
        }
    }
Exemplo n.º 19
0
    public void OnMessageTargetChanged(MessageEventData data)
    {
        SystemUIEvent sys = SystemUIEvent.Instance;

        sys.ChangeTargetTextBox(data.textBoxID);
    }