Ejemplo n.º 1
0
        void Awake()
        {
            musicSource = gameObject.AddComponent <AudioSource> ();

            musicSource.loop = true;

            musicSource.volume = musicVolumn;

            script = gameObject.AddComponent <AudioPlayScript> ();

            if (LocalSettingData.HasKey(MUSIC_PLAY_KEY))
            {
                isMusicPlay = LocalSettingData.GetInt(MUSIC_PLAY_KEY) == 1;
            }

            if (LocalSettingData.HasKey(MUSIC_PLAY_KEY_VOL))
            {
                AudioVol = LocalSettingData.GetFloat(MUSIC_PLAY_KEY_VOL);
            }

            if (LocalSettingData.HasKey(EFFECT_PLAY_KEY_VOL))
            {
                PlayEffectVol = LocalSettingData.GetFloat(EFFECT_PLAY_KEY_VOL);
            }
        }
Ejemplo n.º 2
0
        public AudioPlay()
        {
            GameObject musicPlayer = new GameObject("MusicPlayer");

            musicSource = musicPlayer.AddComponent <AudioSource>();

            musicSource.loop = true;

            script = musicPlayer.AddComponent <AudioPlayScript>();
        }
Ejemplo n.º 3
0
    public void GardAttacked()
    {
        audio_play_script = GardSoundObject.GetComponent <AudioPlayScript>();
        if (enemy_boss_controller.BlockMode)
        {
            rigid.AddForce(new Vector2(-1 * this.transform.localScale.x * 3000, 100));
            audio_play_script.AudioPlay(0.5f);

            //攻撃受けてるとき、ガードしていたら
        }
    }
	void Start ()
	{
		audioPlayer = GameObject.Find ("SoundObject").GetComponent<AudioPlayScript> (); 
		controller = GameObject.Find ("HeadMountedHandController").GetComponent<HandController> ();
		leftHandModel = GameObject.Find ("SecondPlayerLeft");
		rightHandModel = GameObject.Find ("SecondPlayerRight");
		result = GameObject.Find ("ResultText").GetComponent<Text> ();
		poseManager = new PoseManager ();
		if (PhotonNetwork.playerList [0].name == PhotonNetwork.playerName) {
			firstPlayer = true;
			Debug.Log ("first player");
		}
		
	}
Ejemplo n.º 5
0
    public void GardAttacked()
    {
        if (player_controller_script.Dead || player_move_script.RollMode)
        {
            return;
        }
        audio_play_script = GardSoundObject.GetComponent <AudioPlayScript>();
        if (player_controller_script.BlockMode)
        {
            rigid.AddForce(new Vector2(-1 * this.transform.localScale.x * 1000, 100));
            audio_play_script.AudioPlay(0.5f);

            //攻撃受けてるとき、ガードしていたら
        }
    }
Ejemplo n.º 6
0
 public void Attacked(float down, Vector2 KnockPower)
 {
     if (player_controller_script.Dead || player_move_script.RollMode)
     {
         return;
     }
     Attacked_mode = true;
     if (HP > 0)
     {
         if (!player_controller_script.BlockMode)
         {
             HP -= (down - Defense);
         }
         else
         {
             HP -= (down - BlockDefense);
         }
         sliderHP.value = HP / 100.0f;
         if (!animation_mode)
         {
             audio_play_script = AttackedSoundObject.GetComponent <AudioPlayScript>();
             player_controller_script.ResetAttacks();
             animation_mode = true;
             player_controller_script.BlockPermit = false;
             anim.SetTrigger("Hurt");
             player_controller_script.BlockPermit = true;
             StartCoroutine(AnimationTimeChange());
             DamageEvent();
             rigid.AddForce(new Vector2(-1 * this.transform.localScale.x * KnockPower.x, KnockPower.y));
         }
     }
     else
     {
         //死んだら
         if (once)
         {
             audio_play_script = DeadSoundObject.GetComponent <AudioPlayScript>();
             //死んだときのイベントを書く
             player_controller_script.Dead = true;
             anim.SetTrigger("Death");
             rigid.bodyType = RigidbodyType2D.Static;
             audio_play_script.AudioPlay(0f);
             player_controller_script.ResetAttacks();
             StartCoroutine(SceneMoveTimeWait(1.5f));
             once = false;
         }
     }
 }
Ejemplo n.º 7
0
    void Start()
    {
        Screen.orientation = ScreenOrientation.Portrait;
        scrollingTexture = GameObject.Find ("Plane").GetComponent<ScrollingTexture> ();
        anim = GameObject.Find ("MainMenuCanvas").GetComponentInChildren<Animator> ();
        sushianimators = GameObject.Find ("Sushis").GetComponentsInChildren<Animator> ();

        laughingManager = GameObject.Find("LaughingManager").GetComponent<AudioSource>();
        audioPlayScript = audioManager.GetComponent<AudioPlayScript> ();
        laughingPlayScript = laughingManager.GetComponent <LaughingPlayScript> ();
        Invoke ("PlayHelloSound", 0.5f);
    }