コード例 #1
0
ファイル: PlayableMenu.cs プロジェクト: mburton89/Ninjevade
    private void ToggleCharacterToLeft()
    {
//		if(Monk.activeInHierarchy){
//			Monk.SetActive(false);
//			Robo.SetActive(true);
//			CharacterText.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("RoboText", typeof(Sprite)) as Sprite;
//		}
//
//		else if(Wizard.activeInHierarchy){
//			Wizard.SetActive(false);
//			Monk.SetActive(true);
//			CharacterText.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("MonkText", typeof(Sprite)) as Sprite;
//		}
//
//		else if(Gentleman.activeInHierarchy){
//			Gentleman.SetActive(false);
//			Wizard.SetActive(true);
//			CharacterText.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("WizardText", typeof(Sprite)) as Sprite;
//		}
//
//		else if(Robo.activeInHierarchy){
//			Robo.SetActive(false);
//			Gentleman.SetActive(true);
//			CharacterText.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("GentlemanText", typeof(Sprite)) as Sprite;
//		}

        if (Player.gameObject.name.Equals("Player"))
        {
            Player.gameObject.SetActive(false);
            Robo.SetActive(true);
            Player = FindObjectOfType <PlayerAi> ();
            CharacterText.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("RoboText", typeof(Sprite)) as Sprite;

            determineCharacterLockedStatus();
        }

        else if (Player.gameObject.name.Equals("SuperNinja"))
        {
            Player.gameObject.SetActive(false);
            Monk.SetActive(true);
            Player = FindObjectOfType <PlayerAi> ();
            CharacterText.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("MonkText", typeof(Sprite)) as Sprite;

            CharacterLockedStatus.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("BLANKButton", typeof(Sprite)) as Sprite;
            determineLowerGrassStatus();
        }

        else if (Player.gameObject.name.Equals("Punch"))
        {
            Player.gameObject.SetActive(false);
            Wizard.SetActive(true);
            Player = FindObjectOfType <PlayerAi> ();
            CharacterText.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("WizardText", typeof(Sprite)) as Sprite;

            determineCharacterLockedStatus();
        }

        else if (Player.gameObject.name.Equals("Robo"))
        {
            Player.gameObject.SetActive(false);
            Gentleman.SetActive(true);
            Player = FindObjectOfType <PlayerAi> ();
            CharacterText.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("GentlemanText", typeof(Sprite)) as Sprite;

            determineCharacterLockedStatus();
        }
    }
コード例 #2
0
ファイル: PlayableMenu.cs プロジェクト: mburton89/Ninjevade
    //WIP
    private void HandleKeyboard()
    {
        if (Input.GetKeyDown(KeyCode.Alpha8))
        {
//			if(Monk.activeInHierarchy){
//				Monk.SetActive(false);
//				Wizard.SetActive(true);
//				CharacterText.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("WizardText", typeof(Sprite)) as Sprite;
//			}
//
//			else if(Wizard.activeInHierarchy){
//				Wizard.SetActive(false);
//				Gentleman.SetActive(true);
//				CharacterText.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("GentlemanText", typeof(Sprite)) as Sprite;
//			}
//
//			else if(Gentleman.activeInHierarchy){
//				Gentleman.SetActive(false);
//				Robo.SetActive(true);
//				CharacterText.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("RoboText", typeof(Sprite)) as Sprite;
//			}
//
//			else if(Robo.activeInHierarchy){
//				Robo.SetActive(false);
//				Monk.SetActive(true);
//				CharacterText.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("MonkText", typeof(Sprite)) as Sprite;
//			}


            //WIP

            if (Player.gameObject.name.Equals("Player"))
            {
                Player.gameObject.SetActive(false);
                Wizard.SetActive(true);
                Player = FindObjectOfType <PlayerAi> ();
                CharacterText.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("WizardText", typeof(Sprite)) as Sprite;

                CharacterLockedStatus.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("BLANKButton", typeof(Sprite)) as Sprite;

                determineCharacterLockedStatus();
            }

            else if (Player.gameObject.name.Equals("SuperNinja"))
            {
                Player.gameObject.SetActive(false);
                Gentleman.SetActive(true);
                Player = FindObjectOfType <PlayerAi> ();
                CharacterText.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("GentlemanText", typeof(Sprite)) as Sprite;

                determineCharacterLockedStatus();
            }

            else if (Player.gameObject.name.Equals("Punch"))
            {
                Player.gameObject.SetActive(false);
                Robo.SetActive(true);
                Player = FindObjectOfType <PlayerAi> ();
                CharacterText.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("RoboText", typeof(Sprite)) as Sprite;

                determineCharacterLockedStatus();
            }

            else if (Player.gameObject.name.Equals("Robo"))
            {
                Player.gameObject.SetActive(false);
                Monk.SetActive(true);
                Player = FindObjectOfType <PlayerAi> ();
                CharacterText.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("MonkText", typeof(Sprite)) as Sprite;

                CharacterLockedStatus.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("BLANKButton", typeof(Sprite)) as Sprite;
                determineLowerGrassStatus();
            }
        }

        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            if (BGSoundObject.audio.clip.name.Equals("Wind"))
            {
                BGSoundObject.audio.clip = (AudioClip)Resources.Load("NightSound", typeof(AudioClip)) as AudioClip;
                BGSoundObject.audio.Play();

                determineThemeLockedStatus();
            }

            else if (BGSoundObject.audio.clip.name.Equals("NightSound"))
            {
                BGSoundObject.audio.clip = (AudioClip)Resources.Load("RainSound", typeof(AudioClip)) as AudioClip;
                BGSoundObject.audio.Play();

                determineThemeLockedStatus();
            }

            else if (BGSoundObject.audio.clip.name.Equals("RainSound"))
            {
                BGSoundObject.audio.clip = (AudioClip)Resources.Load("SpaceSound", typeof(AudioClip)) as AudioClip;
                BGSoundObject.audio.Play();

                determineThemeLockedStatus();
            }

            else if (BGSoundObject.audio.clip.name.Equals("SpaceSound"))
            {
                BGSoundObject.audio.clip = (AudioClip)Resources.Load("Wind", typeof(AudioClip)) as AudioClip;
                BGSoundObject.audio.Play();

                ThemeLockedStatus.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("BLANKButton", typeof(Sprite)) as Sprite;
                determineLowerGrassStatus();
            }
        }

        else if (Input.GetKeyDown(KeyCode.J))
        {
            Application.LoadLevel(6);
        }
    }