void ReleaseDesignerOutlets()
        {
            if (cnsBackgroundImageHeight != null)
            {
                cnsBackgroundImageHeight.Dispose();
                cnsBackgroundImageHeight = null;
            }

            if (cnsBackgroundImageWidth != null)
            {
                cnsBackgroundImageWidth.Dispose();
                cnsBackgroundImageWidth = null;
            }

            if (cnsDescriptionHeight != null)
            {
                cnsDescriptionHeight.Dispose();
                cnsDescriptionHeight = null;
            }

            if (cnsDescriptionWidth != null)
            {
                cnsDescriptionWidth.Dispose();
                cnsDescriptionWidth = null;
            }

            if (CountdownText != null)
            {
                CountdownText.Dispose();
                CountdownText = null;
            }

            if (ivGenericBackground != null)
            {
                ivGenericBackground.Dispose();
                ivGenericBackground = null;
            }

            if (ivRewardImage != null)
            {
                ivRewardImage.Dispose();
                ivRewardImage = null;
            }

            if (lblClaimIt != null)
            {
                lblClaimIt.Dispose();
                lblClaimIt = null;
            }

            if (lblDescriptionFooter != null)
            {
                lblDescriptionFooter.Dispose();
                lblDescriptionFooter = null;
            }

            if (lblPointsButtonText != null)
            {
                lblPointsButtonText.Dispose();
                lblPointsButtonText = null;
            }

            if (lblStatus != null)
            {
                lblStatus.Dispose();
                lblStatus = null;
            }

            if (lblTapsCount != null)
            {
                lblTapsCount.Dispose();
                lblTapsCount = null;
            }

            if (LockImage != null)
            {
                LockImage.Dispose();
                LockImage = null;
            }

            if (LockImageStatus != null)
            {
                LockImageStatus.Dispose();
                LockImageStatus = null;
            }

            if (NameText != null)
            {
                NameText.Dispose();
                NameText = null;
            }

            if (NotifyButton != null)
            {
                NotifyButton.Dispose();
                NotifyButton = null;
            }

            if (peopleIcon != null)
            {
                peopleIcon.Dispose();
                peopleIcon = null;
            }

            if (RewardButton != null)
            {
                RewardButton.Dispose();
                RewardButton = null;
            }

            if (scrlMainContent != null)
            {
                scrlMainContent.Dispose();
                scrlMainContent = null;
            }

            if (statusTitleLabel != null)
            {
                statusTitleLabel.Dispose();
                statusTitleLabel = null;
            }

            if (SubTitleText != null)
            {
                SubTitleText.Dispose();
                SubTitleText = null;
            }

            if (UnitsAvailable != null)
            {
                UnitsAvailable.Dispose();
                UnitsAvailable = null;
            }

            if (UnlockInTitle != null)
            {
                UnlockInTitle.Dispose();
                UnlockInTitle = null;
            }

            if (UsersEligible != null)
            {
                UsersEligible.Dispose();
                UsersEligible = null;
            }

            if (vBackgroundImageShadow != null)
            {
                vBackgroundImageShadow.Dispose();
                vBackgroundImageShadow = null;
            }

            if (vBasis != null)
            {
                vBasis.Dispose();
                vBasis = null;
            }

            if (vContentBasis != null)
            {
                vContentBasis.Dispose();
                vContentBasis = null;
            }

            if (vEligibleRawBasis != null)
            {
                vEligibleRawBasis.Dispose();
                vEligibleRawBasis = null;
            }

            if (vFiltersRawBasis != null)
            {
                vFiltersRawBasis.Dispose();
                vFiltersRawBasis = null;
            }

            if (vMainContent != null)
            {
                vMainContent.Dispose();
                vMainContent = null;
            }

            if (vRewardsButtonCenterBasis != null)
            {
                vRewardsButtonCenterBasis.Dispose();
                vRewardsButtonCenterBasis = null;
            }

            if (vRewardUnlockTimeContainer != null)
            {
                vRewardUnlockTimeContainer.Dispose();
                vRewardUnlockTimeContainer = null;
            }

            if (vRightBottomBasis != null)
            {
                vRightBottomBasis.Dispose();
                vRightBottomBasis = null;
            }

            if (WebView != null)
            {
                WebView.Dispose();
                WebView = null;
            }
        }
示例#2
0
 void Awake()
 {
     Instance = this;
 }
示例#3
0
    // Update is called once per frame
    void Update()
    {
        for (int i = 0; i < GlobalInput.Fire.Length; i++)
        {
            if (Input.GetButtonDown(GlobalInput.Fire[i]))
            {
                if (GlobalInput.Player1Controller == -1)
                {
                    if (CheckIfPlayerAlreadyAssigned(i))
                    {
                        continue;
                    }

                    GlobalInput.Player1Controller = i;
                    P1Quad.SetActive(true);
                    P1Text.text = "< Select your dog! >";
                }
                else if (GlobalInput.Player2Controller == -1)
                {
                    if (CheckIfPlayerAlreadyAssigned(i))
                    {
                        continue;
                    }

                    GlobalInput.Player2Controller = i;
                    P2Quad.SetActive(true);
                    P2Text.text = "< Select your dog! >";
                }
            }
        }

        if (GlobalInput.Player1Controller != -1 && Input.GetButtonDown(GlobalInput.Back[GlobalInput.Player1Controller]))
        {
            GlobalInput.Player1Controller = -1;
            P1Quad.SetActive(false);
            P1Text.text = "Player 1: Press Fire!";

            if (GlobalInput.Player1DogType == GlobalInput.DogType.Corgi)
            {
                CorgiQuad.transform.Find("Corgi").GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f);
                CorgiSelected = false;
            }
            else if (GlobalInput.Player1DogType == GlobalInput.DogType.Husky)
            {
                HuskyQuad.transform.Find("Husky").GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f);
                HuskySelected = false;
            }

            GlobalInput.Player1DogType = GlobalInput.DogType.None;
        }

        if (GlobalInput.Player2Controller != -1 && Input.GetButtonDown(GlobalInput.Back[GlobalInput.Player2Controller]))
        {
            GlobalInput.Player2Controller = -1;
            P2Quad.SetActive(false);
            P2Text.text = "Player 1: Press Fire!";

            if (GlobalInput.Player2DogType == GlobalInput.DogType.Corgi)
            {
                CorgiQuad.transform.Find("Corgi").GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f);
                CorgiSelected = false;
            }
            else if (GlobalInput.Player2DogType == GlobalInput.DogType.Husky)
            {
                HuskyQuad.transform.Find("Husky").GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f);
                HuskySelected = false;
            }

            GlobalInput.Player2DogType = GlobalInput.DogType.None;
        }

        if (GlobalInput.Player1Controller != -1)
        {
            if (Input.GetAxis(GlobalInput.Horizontal[GlobalInput.Player1Controller]) > 0)
            {
                P1Quad.transform.position = new Vector3(7f, -0.5f, -1f);

                if (!HuskySelected && Input.GetButtonDown(GlobalInput.Fire[GlobalInput.Player1Controller]))
                {
                    HuskyQuad.transform.Find("Husky").GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 0.2f);
                    GlobalInput.Player1DogType = GlobalInput.DogType.Husky;
                    HuskySelected = true;
                    P1Text.text   = "Husky Selected!";
                    P1Quad.SetActive(false);
                }
            }
            else if (Input.GetAxis(GlobalInput.Horizontal[GlobalInput.Player1Controller]) < 0)
            {
                P1Quad.transform.position = new Vector3(-7f, -0.5f, -1f);

                if (!CorgiSelected && Input.GetButtonDown(GlobalInput.Fire[GlobalInput.Player1Controller]))
                {
                    CorgiQuad.transform.Find("Corgi").GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 0.2f);
                    GlobalInput.Player1DogType = GlobalInput.DogType.Corgi;
                    CorgiSelected = true;
                    P1Text.text   = "Corgi Selected!";
                    P1Quad.SetActive(false);
                }
            }
            else
            {
                P1Quad.transform.position = new Vector3(0, -0.5f, -1f);
            }
        }

        if (GlobalInput.Player2Controller != -1)
        {
            if (Input.GetAxis(GlobalInput.Horizontal[GlobalInput.Player2Controller]) > 0)
            {
                P2Quad.transform.position = new Vector3(7f, -3.5f, -1f);

                if (!HuskySelected && Input.GetButtonDown(GlobalInput.Fire[GlobalInput.Player2Controller]))
                {
                    HuskyQuad.transform.Find("Husky").GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 0.2f);
                    GlobalInput.Player2DogType = GlobalInput.DogType.Husky;
                    HuskySelected = true;
                    P2Text.text   = "Husky Selected!";
                    P2Quad.SetActive(false);
                }
            }
            else if (Input.GetAxis(GlobalInput.Horizontal[GlobalInput.Player2Controller]) < 0)
            {
                P2Quad.transform.position = new Vector3(-7f, -3.5f, -1f);

                if (!CorgiSelected && Input.GetButtonDown(GlobalInput.Fire[GlobalInput.Player2Controller]))
                {
                    CorgiQuad.transform.Find("Corgi").GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 0.2f);
                    GlobalInput.Player2DogType = GlobalInput.DogType.Corgi;
                    CorgiSelected = true;
                    P2Text.text   = "Corgi Selected!";
                    P2Quad.SetActive(false);
                }
            }
            else
            {
                P2Quad.transform.position = new Vector3(0, -3.5f, -1f);
            }
        }

        if (CorgiSelected && HuskySelected && countdown == -1)
        {
            countdown = countdownTime;
            CountdownText.gameObject.SetActive(true);
        }
        else if (CountdownText.IsActive() && !(CorgiSelected && HuskySelected))
        {
            countdown = -1;
            CountdownText.gameObject.SetActive(false);
        }


        if (CountdownText.IsActive())
        {
            countdown -= Time.deltaTime;

            CountdownText.text = "Starting in:\n" + Mathf.RoundToInt(countdown);

            if (countdown <= 0)
            {
                countdown = 0;
                SceneManager.LoadScene(nextScene);
            }
        }
    }