コード例 #1
0
        public void Update()
        {
            if (s_instance == null)
            {
                return;
            }

            float time = Time.time;

            if (colorRunning)
            {
                if (colorTime - time < 0 && colorTime - time > -60)
                {
                    if (leftMaterial == null || rightMaterial == null || leftIndicator == null || rightIndicator == null || leftColor == null || rightColor == null)
                    {
                        GetMaterials();
                    }

                    else
                    {
                        colorRunning = false;
                        mleftColor   = leftColor;
                        leftMaterial.SetColor("_EmissionColor", leftColor);
                        leftIndicator.SetColor("_EmissionColor", leftColor);

                        mrightColor = rightColor;
                        rightMaterial.SetColor("_EmissionColor", rightColor);
                        rightIndicator.SetColor("_EmissionColor", rightColor);
                    }
                }
            }

            if (speedRunning)
            {
                if (speedTime - time < 0 && speedTime - time > -60)
                {
                    speedRunning = false;
                    setPitchCallback(1f);
                }
            }

            if (nameRunning)
            {
                if (nameTime - time < 0 && nameTime - time > -60)
                {
                    nameRunning = false;
                    UserTextScript.HideMe();
                }
            }

            if (mleftColor != null && mrightColor != null && leftIndicator != null && rightIndicator != null)
            {
                if (leftIndicator.GetColor("_EmissionColor") != mleftColor || rightIndicator.GetColor("_EmissionColor") != mrightColor)
                {
                    leftIndicator.SetColor("_EmissionColor", mleftColor);
                    rightIndicator.SetColor("_EmissionColor", mrightColor);
                }
            }
        }
コード例 #2
0
        void Awake()
        {
            if (s_instance != null)
            {
                Destroy(this);
            }

            s_instance = this;
            DontDestroyOnLoad(this);
        }
コード例 #3
0
        public static void NameCommand(string user, float time)
        {
            if (settings.showUserText == true)
            {
                nameTime    = Time.time + time;
                nameRunning = true;

                GameObject platform = GameObject.Find("HeadsetFollower");
                userText.transform.position = platform.transform.position;

                UserTextScript.SetText(user);
                UserTextScript.ShowMe();
            }
        }