Example #1
0
    IEnumerator StartGameSequence()
    {
        GlobalGUI.SetText("Ready...");
        Score.Set(0);
        yield return(new WaitForSeconds(5f));

        GlobalGUI.SetText("GO!!");
        Sound.Play("GameStart");
        yield return(new WaitForSeconds(1f));

        IsGameStarted_ = true;

        foreach (var obj in Instance.makeActiveAtStartScripts)
        {
            obj.enabled = true;
        }

        GlobalGUI.SetText("GO!!");
        yield return(new WaitForSeconds(1f));

        GlobalGUI.SetText("");
        yield return(new WaitForSeconds(1f));

        Sound.Play("BGM");
    }
Example #2
0
        void UpdateClientInformation(string[] args)
        {
            if (args.Length < 4)
            {
                Debug.LogWarning("Invalid arguments for SetMaster");
                return;
            }

            IsMaster       = args[1].AsBool();
            Timestamp      = args[2].AsUlong();
            ConnectionsNum = args[3].AsInt();

            GlobalGUI.SetNum(ConnectionsNum.ToString());
        }
Example #3
0
    IEnumerator FinishGameSequence()
    {
        GlobalGUI.SetText("Finish!");
        yield return(new WaitForSeconds(3f));

        GlobalGUI.SetText("Your Score is...");
        yield return(new WaitForSeconds(2f));

        GlobalGUI.SetText(Score.Get().ToString());
        yield return(new WaitForSeconds(5f));

        var markers = MarkerManager.GetMarkerObjects();

        if (markers.Count == 0)
        {
            while (markers.Count == 0)
            {
                GlobalGUI.SetText("Please Put LITTAI button!");
                yield return(new WaitForSeconds(1f));

                markers = MarkerManager.GetMarkerObjects();
            }
        }
        yield return(new WaitForSeconds(1f));

        try {
            bool isHit = false;
            foreach (var marker in markers)
            {
                if (marker)
                {
                    Ranking.Post(Score.Get(), markers[0].gameObject);
                    isHit = true;
                    break;
                }
            }
            Debug.LogError("No Marker...");
        } catch (System.Exception e) {
            Debug.LogError(e.Message);
        }

        GlobalGUI.SetText("Thank you for playing!");
        GlobalGUI.ShowBgmRefer(true);
        yield return(new WaitForSeconds(6f));

        Restart();
    }
Example #4
0
    void Awake()
    {
        // Make sure there is only 1 instance of this class.
        if (instance == null)
        {
            show             = false;
            achievementQueue = new Queue <CTAchievement>();
            DontDestroyOnLoad(gameObject);
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        #region Calculate GUI Components

        // Calculate size of achievement popup
        achievementPopupTexture = activeSkin.customStyles[0].normal.background;
        float aPopupHeight  = Screen.height * achievementPopupScale;
        float aPopupWidth   = aPopupHeight * ((float)achievementPopupTexture.width / (float)achievementPopupTexture.height);
        float aPopupXOffset = 0.5f * (Screen.width - aPopupWidth);
        float aPopupYOffset = Screen.height * achievementPopupYOffset;

        achievementContainerRect = new Rect(aPopupXOffset, aPopupYOffset, aPopupWidth, aPopupHeight);
        achievementPopupOpened   = new Rect(0, 0, aPopupWidth, aPopupHeight);
        achievementPopupClosed   = new Rect(aPopupWidth * 0.5f, aPopupHeight * 0.5f, 0, 0);

        achievementLabelStyle          = new GUIStyle(activeSkin.label);
        achievementLabelStyle.fontSize = (int)(aPopupHeight * achievementLabelScale);
        float contentXOffset = aPopupWidth * achievementLabelXOffset;
        float contentYOffset = aPopupHeight * achievementLabelYOffset;
        float contentWidth   = aPopupWidth * achievementLabelWidth;
        float contentHeight  = aPopupHeight * achievementLabelHeight;

        achievementLabelOpened = new Rect(contentXOffset, contentYOffset, contentWidth, contentHeight);
        achievementLabelClosed = new Rect(0.5f * (contentXOffset + contentWidth), 0.5f * (contentYOffset + contentHeight), 0, 0);

        ResetAchievementPopup();

        #endregion
    }
Example #5
0
    void ChangeMode()
    {
        if (Input.GetKeyDown(KeyCode.Keypad1) || Input.GetKeyDown(KeyCode.Alpha1))
        {
            fireMode = FireMode.FireBullet;
        }
        if (Input.GetKeyDown(KeyCode.Keypad2) || Input.GetKeyDown(KeyCode.Alpha2))
        {
            fireMode = FireMode.CreateBlock;
        }
        if (Input.GetKeyDown(KeyCode.Keypad3) || Input.GetKeyDown(KeyCode.Alpha3))
        {
            fireMode = FireMode.DeleteBlock;
        }
        if (Input.GetKeyDown(KeyCode.Keypad4) || Input.GetKeyDown(KeyCode.Alpha4))
        {
            fireMode = FireMode.ChangeBlockColor;
        }

        switch (fireMode)
        {
        case FireMode.FireBullet:
            GlobalGUI.SetTool("BULLET");
            break;

        case FireMode.CreateBlock:
            GlobalGUI.SetTool("+BLOCK");
            break;

        case FireMode.DeleteBlock:
            GlobalGUI.SetTool("-BLOCK");
            break;

        case FireMode.ChangeBlockColor:
            GlobalGUI.SetTool("COLOR");
            break;
        }
    }
Example #6
0
 void Awake()
 {
     Instance = this;
 }
Example #7
0
 void Awake()
 {
     Instance = this;
 }