Exemple #1
0
        // This is for minimizing the sidebar
        private void logo_Click(object sender, EventArgs e)
        {
            // Hiding and showing specific images
            logo.Visible        = false;
            pictureBox2.Visible = true;

            // Setting the size from large to minimized
            if (sidemenu.Width == 50)
            {
                // The animation stuff
                sidemenu.Visible = false;
                sidemenu.Width   = 251;
                PanelAnimation.ShowSync(sidemenu);
                LogoAnimation.ShowSync(logo);
            }
            // Redundancy that will NEVER be called, but is here incase of a weird glitch
            else
            {
                // The animation stuff
                LogoAnimation.Hide(logo);
                sidemenu.Visible = false;
                sidemenu.Width   = 50;
                PanelAnimation.ShowSync(sidemenu);
            }
        }
Exemple #2
0
 void Start()
 {
     infoText.text = string.Empty;
     inputField.onValueChanged.AddListener(OnInputChanged);
     enterBtn.onClick.AddListener(OnEnterBtnClick);
     enterBtn.interactable = false;
     closeBtn.onClick.AddListener(OnCloseBtnClick);
     myAnimation = this.GetComponent <PanelAnimation>();
 }
Exemple #3
0
 public void ReturnToLife()
 {
     if (returnItem > 0)
     {
         PanelAnimation.HideCurrentPanel();
         Time.timeScale = 1.0f;
         health         = 100;
         destroyerForMeteorits++;
         DestroyAllMeteorits();
         returnItem--;
         PlayerStats.Current.ReturnItem = returnItem;
     }
 }
 private void btnMenu_Click(object sender, EventArgs e)
 {
     if (SlideMenu.Width == 50)
     {
         SlideMenu.Visible = false;
         SlideMenu.Width   = 260;
         PanelAnimation.ShowSync(SlideMenu);
     }
     else
     {
         SlideMenu.Width = 50;
     }
 }
Exemple #5
0
 public void ShowPanel()
 {
     PanelAnimation.HideCurrentPanel();
     if (!isPlayed)
     {
         panelToControll.SetActive(true);
         currentPanel = panelToControll;
         if (!animationController)
         {
             animationController = panelToControll.GetComponent <Animator>();
         }
         animationController.Play(StringNamesInfo.SHOWPANEL_animation);
         isPlayed = true;
     }
 }
Exemple #6
0
        //Xử lý đóng mở menu

        private void btnMenu_Click(object sender, EventArgs e)
        {
            if (Sidemenu.Width == 80)
            {
                btnMenu.Location = new Point(260, 0);
                Sidemenu.Visible = false;
                Sidemenu.Width   = 300;
                PanelAnimation.ShowSync(Sidemenu);
            }
            else
            {
                Sidemenu.Visible = false;
                Sidemenu.Width   = 80;
                btnMenu.Location = new Point(20, 58);
                PanelAnimation2.ShowSync(Sidemenu);
            }
        }
Exemple #7
0
 void Awake()
 {
     animController = gameObject.GetComponent <PanelAnimation>();
 }
Exemple #8
0
        void Start()
        {
            //PlayerPrefs.SetInt("Profit", 0);
            //PlayerPrefs.SetInt("AllScore",0);
            //PlayerPrefs.SetInt("GameCounter", 0);
            //PlayerPrefs.SetInt("BestScore", Random.Range(500,1000));
            audio       = gameObject.AddComponent <AudioSource>();
            profit      = PlayerPrefs.GetInt("Profit");
            bestScore   = PlayerPrefs.GetInt("BestScore");
            allScore    = PlayerPrefs.GetInt("AllScore");
            gameCounter = PlayerPrefs.GetInt("GameCounter");
            if (allScore < 1000)
            {
                allScore = 1000;
            }
            if (gameCounter < 10)
            {
                gameCounter = 10;
            }

            if (JavaInterface.Java())
            {
                if (bestScore < 500)
                {
                    bestScore = Random.Range(500, 1000);
                }

                playerText = Instantiate(texts[5]).GetComponent <CustomText>();
                playerText.transform.parent     = transform;
                playerText.transform.position   = new Vector3(-1.125f, 0.5f);
                playerText.transform.localScale = new Vector3(0.15f, 0.15f);

                scoreText = Instantiate(texts[7]).GetComponent <CustomText>();
                scoreText.transform.parent     = transform;
                scoreText.transform.position   = new Vector3(-1.125f, 0.40f);
                scoreText.transform.localScale = new Vector3(0.075f, 0.075f);
                //scoreText.Init();
                //scoreText.Display(0);
                //playerText.gameObject.SetActive(false);
            }
            else
            {
                mAuidoOption = Instantiate(audioOption).GetComponent <OptionAnimation>();
                mAuidoOption.transform.parent     = transform;
                mAuidoOption.transform.localScale = new Vector3(1.5f, 1.5f, 1f);
                mAuidoOption.transform.position   = new Vector3(1.15f, 0.575f);

                //Debug.Log(mAuidoOption);
                EventListener.Get(mAuidoOption.gameObject).onClick += (GameObject obj) =>
                {
                    mAuidoOption.OnClick();
                };
                EventListener.Get(mAuidoOption.gameObject).onPress += (GameObject obj) =>
                {
                    mAuidoOption.OnPress();
                };
                EventListener.Get(mAuidoOption.gameObject).onFree += (GameObject obj) =>
                {
                    mAuidoOption.OnFree();
                };
            }
            mChopLeft  = Instantiate(chopLeft).GetComponent <ChopAnimation>();
            mChopRight = Instantiate(chopRight).GetComponent <ChopAnimation>();
            mChopLeft.transform.parent    = transform;
            mChopRight.transform.parent   = transform;
            mChopLeft.transform.position  = new Vector3(-0.75f, -0.125f);
            mChopRight.transform.position = new Vector3(0.75f, -0.125f);

            mChopLeft.Hide();
            mChopRight.Hide();



            gameText = Instantiate(texts[4]).GetComponent <CustomText>();
            gameText.transform.parent     = transform;
            gameText.transform.position   = new Vector3(0, 0.25f);
            gameText.transform.localScale = new Vector3(0.25f, 0.25f, 1);
            gameText.gameObject.SetActive(false);

            mMainPanel = Instantiate(mainPanel).GetComponent <PanelAnimation>();

            lastScoreText = Instantiate(texts[6]).GetComponent <CustomText>();
            lastScoreText.transform.parent     = mMainPanel.transform;
            lastScoreText.transform.localScale = new Vector3(0.1f, 0.2f);
            lastScoreText.transform.position   = mMainPanel.transform.position + new Vector3(0, -0.675f);

            bestText = Instantiate(texts[6]).GetComponent <CustomText>();
            bestText.transform.parent   = mMainPanel.transform;
            bestText.transform.position = mMainPanel.transform.position + new Vector3(0, -0.425f);
            bestText.Display(bestScore);

            mScroll = Instantiate(scroll).GetComponent <ScrollAnimation>();
            mScroll.transform.position = new Vector3(0, 0.65f);
            mScroll.transform.parent   = transform;
            mScroll.gameObject.SetActive(false);

            mScrollMain = Instantiate(scrollMain).GetComponent <ScrollAnimation>();
            mScrollMain.transform.position = new Vector3(1.2f, -0.15f);
            mScrollMain.transform.parent   = transform;

            mScrollMain.GetComponent <Renderer>().material.color = new Color(1, 1, 1, 0);
            for (int i = 0; i < mScrollMain.transform.childCount; i++)
            {
                mScrollMain.transform.GetChild(i).GetComponent <Renderer>().material.color = new Color(1, 1, 1, 0);
            }

            mAwards = mScrollMain.GetComponent <AwardsAnimation>();
            mScrollMain.gameObject.SetActive(false);

            if (JavaInterface.Java() == true)
            {
                mWelcome = Instantiate(welcomeArcade).GetComponent <WelcomeAnimation>();
            }
            else
            {
                mWelcome = Instantiate(welcomeMobile).GetComponent <WelcomeAnimation>();
            }
            mWelcome.transform.position = transform.position;
            mWelcome.transform.parent   = transform;
            //mWelcome.transform.localScale = new Vector3(2, 2);
            mWelcome.Hide();
            mWelcome.gameObject.GetComponent <Collider>().enabled = false;

            GameEvent.onGetScore    += OnGetScore;
            GameEvent.onDeath       += OnDeath;
            GameEvent.onFinishGame  += OnFinishGame;
            GameEvent.onReset       += OnReset;
            GameEvent.startReset    += StartReset;
            GameEvent.finishReset   += FinishReset;
            GameEvent.onHealth      += OnHealth;
            GameEvent.onStartGame   += OnStartGame;
            GameEvent.onWelcome     += OnWelcome;
            GameEvent.offWelcome    += OffWelcome;
            GameEvent.waitStartGame += WaitStartGame;
            GameEvent.onLaunchGame  += OnLaunchGame;

            EventListener.Get(mWelcome.gameObject).onClick += (GameObject obj) =>
            {
                GameController.isLaunchGame = true;
            };
            EventListener.Get(mChopLeft.gameObject).onPress += (GameObject obj) =>
            {
                GameController.isLaunchGame = true;
                GameEvent.OnAttackLeft(PlayerController.players[0]);
            };
            EventListener.Get(mChopRight.gameObject).onPress += (GameObject obj) =>
            {
                GameController.isLaunchGame = true;
                GameEvent.OnAttackRight(PlayerController.players[0]);
            };

            InputPort.onChangeScoreEvent += (int value) =>
            {
                playerText.Display(value / 10, 0.1f);
                scoreText.Display(value % 10, 0.1f);
            };
        }