Exemplo n.º 1
0
 private void Awake()
 {
     if (!Instance)
     {
         Instance   = this;
         transition = GetComponent <UITransition>();
         img        = GetComponent <Image>();
     }
 }
Exemplo n.º 2
0
 private static void SetDefaultTransitionAnim(Transform ui, bool need_scale)
 {
     //IL_0001: Unknown result type (might be due to invalid IL or missing references)
     //IL_0018: Unknown result type (might be due to invalid IL or missing references)
     //IL_0067: Unknown result type (might be due to invalid IL or missing references)
     //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
     //IL_00d5: Unknown result type (might be due to invalid IL or missing references)
     //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
     //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
     //IL_011f: Unknown result type (might be due to invalid IL or missing references)
     //IL_016a: Unknown result type (might be due to invalid IL or missing references)
     //IL_0178: Unknown result type (might be due to invalid IL or missing references)
     //IL_017d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0192: Unknown result type (might be due to invalid IL or missing references)
     //IL_0197: Unknown result type (might be due to invalid IL or missing references)
     if (!(ui.get_gameObject().GetComponentInChildren <UITransition>() != null))
     {
         UITransition uITransition = ui.get_gameObject().AddComponent <UITransition>();
         float        duration     = (!MonoBehaviourSingleton <GlobalSettingsManager> .IsValid()) ? 0.25f : MonoBehaviourSingleton <GlobalSettingsManager> .I.defaultUITransitionAnimTime;
         int          num          = (!need_scale) ? 1 : 2;
         uITransition.openTweens = new UITweener[num];
         TweenAlpha tweenAlpha = (TweenAlpha)(uITransition.openTweens[0] = ui.get_gameObject().AddComponent <TweenAlpha>());
         tweenAlpha.value = 0f;
         tweenAlpha.SetStartToCurrentValue();
         tweenAlpha.to              = 1f;
         tweenAlpha.duration        = duration;
         tweenAlpha.animationCurve  = Curves.easeLinear;
         tweenAlpha.ignoreTimeScale = false;
         if (need_scale)
         {
             TweenScale tweenScale = (TweenScale)(uITransition.openTweens[1] = ui.get_gameObject().AddComponent <TweenScale>());
             tweenScale.value = new Vector3(1.05f, 1.05f, 1f);
             tweenScale.SetStartToCurrentValue();
             tweenScale.to              = Vector3.get_one();
             tweenScale.duration        = duration;
             tweenScale.animationCurve  = Curves.easeIn;
             tweenScale.ignoreTimeScale = false;
         }
         uITransition.closeTweens = new UITweener[num];
         tweenAlpha                 = (TweenAlpha)(uITransition.closeTweens[0] = ui.get_gameObject().AddComponent <TweenAlpha>());
         tweenAlpha.from            = 1f;
         tweenAlpha.to              = 0f;
         tweenAlpha.duration        = duration;
         tweenAlpha.animationCurve  = Curves.easeLinear;
         tweenAlpha.ignoreTimeScale = false;
         if (need_scale)
         {
             TweenScale tweenScale = (TweenScale)(uITransition.closeTweens[1] = ui.get_gameObject().AddComponent <TweenScale>());
             tweenScale.from            = Vector3.get_one();
             tweenScale.to              = new Vector3(1.05f, 1.05f, 1f);
             tweenScale.duration        = duration;
             tweenScale.animationCurve  = Curves.easeIn;
             tweenScale.ignoreTimeScale = false;
         }
         uITransition.InitTweens();
     }
 }
Exemplo n.º 3
0
 void Awake()
 {
     if (!Instance)
     {
         Instance   = this;
         transition = GetComponent <UITransition>();
         text       = GetComponentInChildren <RTLTMPro.RTLTextMeshPro>();
     }
 }
 public override void Hide()
 {
     base.Hide();
     if (direction == Direction.LEFT)
     {
         UITransition.MoveRight(ContentView.transform, getContentViewWidth());
         UITransition.MoveRight(transform, getContentViewWidth());
     }
     else
     {
     }
 }
Exemplo n.º 5
0
 public override void Show()
 {
     base.Show();
     if (direction == Direction.BOTTOM)
     {
         UITransition.MoveUp(ContentView.transform, getContentViewHeight());
         UITransition.MoveUp(transform, getContentViewHeight());
         Debug.Log("Move Up");
     }
     else
     {
         // TODO: TOP CASE
     }
 }
Exemplo n.º 6
0
    private void Transition(bool isHide, bool isReverse, Action onComplete)
    {
        gameObject.SetActive(true);

        int siblingCount    = _rectTransform.parent.childCount;
        int navigatorOffset = HasNavigator ? 1 : 0;

        if (!isHide && !isReverse) // right-most screen is always on top
        {
            _rectTransform.SetSiblingIndex(siblingCount - navigatorOffset);
        }

        UITransition.Transition(ref _rectTransform, isHide, isReverse, onComplete);
    }
Exemplo n.º 7
0
    public void Init(UIPanel container)
    {
        _parentPanel = container;

        _transition = GetComponent <UITransition>();

        if (_transition == null)
        {
            transform.localScale = Vector3.zero;
        }
        _transition.Init(container);

        _waitForHideDelay = new WaitForSeconds(_hideDelay);
        _waitForShowDelay = new WaitForSeconds(_showDelay);
    }
Exemplo n.º 8
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        UITransition transitionScript = (UITransition)target;

        if (GUILayout.Button("Forward"))
        {
            transitionScript.Forward();
        }

        if (GUILayout.Button("Backward"))
        {
            transitionScript.Backward();
        }
    }
Exemplo n.º 9
0
    private void Transition(bool isHide, bool isReverse, Action onComplete)
    {
        gameObject.SetActive(true);

        Transform overlayContainerTransform = _rectTransform.parent;

        int siblingCount    = overlayContainerTransform.parent.childCount;
        int navigatorOffset = gameObject.activeSelf ? 0 : 1;

        if (!isHide && !isReverse) // right-most screen is always on top
        {
            overlayContainerTransform.SetSiblingIndex(siblingCount - navigatorOffset);
        }

        UITransition.Transition(ref _rectTransform, isHide, isReverse, onComplete);
    }
Exemplo n.º 10
0
    //-----------------------------------------------------------------------------START METHODS MENU CONTROL--------------------------------------------------------------------\\
    #region
    // Set the basics settings
    void basicSettings()
    {
        // Active or deactivated first objets in scene
        mainScreen.SetActive(true);
        creditsScreen.SetActive(false);
        creditsTextBack.SetActive(false);
        modesScreen.SetActive(false);
        levelScreen.SetActive(false);
        optionsScreen.SetActive(false);
        QualitySettings.masterTextureLimit = 1;


        if (!File.Exists(Application.persistentDataPath + "/gamesettings.json"))
        {
            GameConfig _gameConfig;
            _gameConfig = new GameConfig();
            string jsonData = JsonUtility.ToJson(_gameConfig, true);                                            // Converts the class to the json file
            File.WriteAllText(Application.persistentDataPath + "/gamesettings.json", jsonData);                 // Save the jsonData (class _gameConfig) in persistenceData
            Debug.LogWarning("MENU_KIT: gamesettings.json was created!");
        }

        if (inGame == false)
        {
            setAlphaMask(0.5f);
        }
        else
        {
            setAlphaMask(0.7f);
        }

        // Get all components
        _rectCredits  = creditsScreen.GetComponent <RectTransform>();
        _uitransition = this.GetComponent <UITransition> ();

        // Set Custom Cursor
        if (useCustomCursor == true && inGame == false)
        {
            Cursor.SetCursor(cursor, _hotSpot, CursorMode.ForceSoftware);
        }

        // Play background song
        if (canPlayBackgroundSong)
        {
            playBackgroundAudio();
            Debug.Log("Background Audio is Play");
        }
    }    // END
Exemplo n.º 11
0
        public static void DoTransition <TDstPanel>(this UIPanel selfBehaviour, UITransition transition,
                                                    UILevel uiLevel        = UILevel.Common,
                                                    IUIData uiData         = null,
                                                    string assetBundleName = null,
                                                    string prefabName      = null) where TDstPanel : UIPanel
        {
            transition.FromPanel   = selfBehaviour;
            transition.InCompleted = () =>
            {
                UIKit.OpenPanel <TDstPanel>(uiLevel, uiData, assetBundleName, prefabName);
            };


            UIKit.OpenPanel <UITransitionPanel>(UILevel.PopUI, new UITransitionPanelData()
            {
                Transition = transition
            }, prefabName: "Resources/UITransitionPanel");
        }
Exemplo n.º 12
0
    //-----------------------------------------------------------------------------START METHODS MENU CONTROL--------------------------------------------------------------------\\
    // Set the basics settings
    void basicSettings()
    {
        // Active or deactivated first objets in scene
        mainScreen.SetActive(true);
        creditsScreen.SetActive(false);
        creditsTextBack.SetActive(false);
        modesScreen.SetActive(false);
        optionsScreen.SetActive(false);

        setAlphaMask(0.5f);

        // Get all components
        _rectCredits  = creditsScreen.GetComponent <RectTransform>();
        _uitransition = this.GetComponent <UITransition> ();

        // Set Custom Cursor
        if (useCustomCursor == true)
        {
            Cursor.SetCursor(cursor, _hotSpot, CursorMode.ForceSoftware);
        }
    }    // END
Exemplo n.º 13
0
    /// <summary>
    /// Shows an overlay over the given rect area.
    /// </summary>
    /// <param name="rect">the rect that will be covered by the overlayLoading</param>
    public void Show(RectTransform rect)
    {
        UITransition  overlayImage = Instantiate(overlayPrefab, rect);
        RectTransform rt           = overlayImage.GetComponent <RectTransform>();

        rt.anchorMin = Vector2.zero;
        rt.anchorMax = Vector2.one;
        rt.sizeDelta = Vector2.zero;
        rt.SetParent(rect);
        rt.SetAsLastSibling();
        if (rt.GetComponentInParent <ScrollRect>())
        {
            rt.GetComponentInParent <ScrollRect>().enabled = false;
        }
        overlayImage.Show();
        overlayImage.onHidden.AddListener(delegate {
            Destroy(overlayImage.gameObject);
            if (rt.GetComponentInParent <ScrollRect>())
            {
                rt.GetComponentInParent <ScrollRect>().enabled = true;
            }
        });
        anchoredLoadings.Add(overlayImage);
    }
    public SceneData CreateSceneData(string scene_name, TextAsset text_asset)
    {
        //IL_012e: Unknown result type (might be due to invalid IL or missing references)
        try
        {
            CSVReader cSVReader = new CSVReader(text_asset.get_text(), "name,type,useRes,loadRes,appVer,evName,evTo,retBtn,strKey,strJP", true);
            SceneData sceneData = new SceneData();
            sceneData.sceneName = scene_name;
            SectionData sectionData = null;
            string      text        = null;
            while (cSVReader.NextLine())
            {
                string value   = string.Empty;
                string value2  = string.Empty;
                string value3  = string.Empty;
                string value4  = string.Empty;
                string value5  = string.Empty;
                string value6  = string.Empty;
                string value7  = string.Empty;
                int    value8  = 0;
                string value9  = string.Empty;
                string value10 = string.Empty;
                cSVReader.Pop(ref value);
                cSVReader.Pop(ref value2);
                cSVReader.Pop(ref value3);
                cSVReader.Pop(ref value4);
                cSVReader.Pop(ref value5);
                cSVReader.Pop(ref value6);
                cSVReader.Pop(ref value7);
                cSVReader.Pop(ref value8);
                cSVReader.Pop(ref value9);
                cSVReader.Pop(ref value10);
                if (value.Length > 0)
                {
                    sectionData = new SectionData();
                    if (value == "SCENE")
                    {
                        value = scene_name + "Scene";
                    }
                    sectionData.sectionName = value;
                    if (text != null && value == text)
                    {
                        sectionData.isTop = true;
                        text = null;
                    }
                    if (value2.Length == 0)
                    {
                        throw new UnityException("scene table parse error");
                    }
                    sectionData.typeParams = value2.Split(new char[1]
                    {
                        ':'
                    }, StringSplitOptions.RemoveEmptyEntries);
                    try
                    {
                        sectionData.type = (GAME_SECTION_TYPE)(int)Enum.Parse(typeof(GAME_SECTION_TYPE), sectionData.typeParams[0]);
                    }
                    catch (Exception)
                    {
                        sectionData.type = GAME_SECTION_TYPE.COMMON_DIALOG;
                    }
                    sectionData.backButtonIndex = value8;
                    sceneData.sectionList.Add(sectionData);
                }
                if (value3.Length > 0)
                {
                    sectionData.useResourceList.Add(value3);
                }
                if (value4.Length > 0)
                {
                    if (sectionData.preloadResourceList == null)
                    {
                        sectionData.preloadResourceList = new List <string>();
                    }
                    sectionData.preloadResourceList.Add(value4);
                }
                if (value6.Length > 0 || value7.Length > 0)
                {
                    EventData eventData = new EventData();
                    eventData.appVer    = value5;
                    eventData.eventName = value6;
                    if (sectionData.type == GAME_SECTION_TYPE.SCENE && value6.Length == 0 && value7.Length > 0)
                    {
                        text = value7;
                    }
                    string[] array = value7.Split(':');
                    eventData.toSectionName = array[0];
                    eventData.closeType     = UITransition.TYPE.CLOSE;
                    eventData.openType      = UITransition.TYPE.OPEN;
                    int i = 1;
                    for (int num = array.Length; i < num; i++)
                    {
                        string text2 = array[i];
                        if (text2.Length == 3 && text2[1] == '>')
                        {
                            if (text2[0] == 'c')
                            {
                                eventData.closeType = UITransition.GetType(text2[2]);
                            }
                            else if (text2[0] == 'o')
                            {
                                eventData.openType = UITransition.GetType(text2[2]);
                            }
                        }
                    }
                    if (sectionData.eventDataList == null)
                    {
                        sectionData.eventDataList = new List <EventData>();
                    }
                    sectionData.eventDataList.Add(eventData);
                }
                if (value9.Length > 0 || value10.Length > 0)
                {
                    TextData textData = new TextData();
                    textData.key  = value9;
                    textData.text = value10;
                    if (sectionData.textList == null)
                    {
                        sectionData.textList = new List <TextData>();
                    }
                    sectionData.textList.Add(textData);
                }
            }
            sceneDataTable.Add(scene_name, sceneData);
            return(sceneData);

IL_038e:
            SceneData result;
            return(result);
        }
        catch (Exception exc)
        {
            Log.Exception(exc);
            return(null);

IL_03a4:
            SceneData result;
            return(result);
        }
    }
Exemplo n.º 15
0
 void Awake()
 {
     uITransition = GetComponentInParent <UITransition>();
 }