示例#1
0
 // Use this for initialization
 void Start()
 {
     buttons          = new List <GameObject>();
     buttonScale      = new ButtonScale();
     lastScreenHeight = Screen.height;
     lastScreenWidth  = Screen.width;
     buttonScale.Initialize(referenceButtonSize, referenceScreenSize, (int)mode);
     circSpawner.FitDistanceToScreenSize(buttonScale.referenceScreenSize);
     linSpawner.FitSpacingToScreenSize(buttonScale.referenceScreenSize);
     if (revealSettings.revealOnStart)
     {
         SpawnButtons();
     }
 }
示例#2
0
    void Update()
    {
        if (Screen.width != lastScreenWidth || Screen.height != lastScreenHeight)
        {
            lastScreenWidth  = Screen.width;
            lastScreenHeight = Screen.height;
            buttonScale.Initialize(referenceButtonSize, referenceScreenSize, (int)mode);
            circSpawner.FitDistanceToScreenSize(buttonScale.referenceScreenSize);
            linSpawner.FitSpacingToScreenSize(buttonScale.referenceScreenSize);
            SpawnButtons();
        }
        if (revealSettings.opening)
        {
            if (revealSettings.spawned)
            {
                SpawnButtons();
            }

            switch (revealSettings.option)
            {
            case RevealSettings.RevealOption.Linear:
                switch (linSpawner.revealStyle)
                {
                case LinearSpawner.RevealStyle.SlidetToPosition:
                    RevealLinearlyNormal();
                    break;

                case LinearSpawner.RevealStyle.FadeInAtPosition:
                    RevealLinearlyFade();
                    break;
                }
                break;

            case RevealSettings.RevealOption.Circular:
                switch (circSpawner.revealStyle)
                {
                case CircularSpawner.RevealStyle.SlideToPosition:
                    RevealLinearlyNormal();
                    break;

                case CircularSpawner.RevealStyle.FadeInAtPosition:
                    RevealLinearlyFade();
                    break;
                }
                break;
            }
        }
    }