void init() { Action_Manager action = GameObject.Find("Action_Manager").GetComponent <Action_Manager>(); Sound_Manager sound_Manager = GameObject.Find("Sound_Manager").GetComponent <Sound_Manager>(); PlayerControl_Manager playerControl = GameObject.Find("PlayerControl").GetComponent <PlayerControl_Manager>(); if (action) { Debug.Log("action 잡음"); } if (sound_Manager) { Debug.Log("sound_Manager 잡음"); } if (playerControl) { Debug.Log("playerControl 잡음"); } //action.init(); //sound_Manager.init(); //playerControl.init(); }
public void Damage(Enemy attacker, float damageMultiplier) { Vector3 attackerPosition = GetPosition(); if (attacker != null) { attackerPosition = attacker.GetPosition(); } int damageAmount = Mathf.RoundToInt(8 * damageMultiplier * UnityEngine.Random.Range(.8f, 1.2f)); bool isInvulnerable = Time.time < invulnerableTime; if (!isInvulnerable) { healthSystem.Damage(damageAmount); DamagePopup.Create(GetPosition(), damageAmount, true); } Sound_Manager.PlaySound(Sound_Manager.Sound.Player_Hit, GetPosition()); Vector3 bloodDir = (GetPosition() - attackerPosition).normalized; BloodParticleSystemHandler.Instance.SpawnBlood(5, GetPosition(), bloodDir); }
void Awake() { SetHoverBehaviourType(hoverBehaviourType); #if SOUND_MANAGER // Sound Manager internalOnPointerEnterFunc += () => { if (mouseOverSound != Sound_Manager.Sound.None) { Sound_Manager.PlaySound(mouseOverSound); } }; internalOnPointerClickFunc += () => { if (mouseClickSound != Sound_Manager.Sound.None) { Sound_Manager.PlaySound(mouseClickSound); } }; #endif #if CURSOR_MANAGER // Cursor Manager internalOnPointerEnterFunc += () => { if (cursorMouseOver != CursorManager.CursorType.None) { CursorManager.SetCursor(cursorMouseOver); } }; internalOnPointerExitFunc += () => { if (cursorMouseOut != CursorManager.CursorType.None) { CursorManager.SetCursor(cursorMouseOut); } }; #endif }
//접시에 재료가 쌓일때 실행되는 함수 public static void checkBuggerStack(string drop_incredi) { //만약 재료의 이름이 알맞다면 if (drop_incredi.Equals(now_bugger_incredi)) { Sound_Manager.PlaySound("sd_dish_perfect"); //재료가 다 쌓였으니 점수 증가 시키고 새로운 버거를 만든다 if (bugger_stack == 5) { addScore(10); makeBuggerStack(); } //아직 버거가 덜 쌓였으면 다음에 쌓아야 할 재료의 값을 가져온다 else { now_bugger_incredi = goal_bugger_stack[++bugger_stack]; } } //알맞은 재료가 아니면 라이프를 마이너스 시킨다 else { minusLife(1); } }
void Awake() { posExit = transform.localPosition; posEnter = (Vector2)transform.localPosition + hoverBehaviour_Move_Amount; SetHoverBehaviourType(hoverBehaviourType); #if SOUND_MANAGER // Sound Manager internalOnPointerEnterFunc += () => { if (mouseOverSound != Sound_Manager.Sound.None) { Sound_Manager.PlaySound(mouseOverSound); } }; internalOnPointerClickFunc += () => { if (mouseClickSound != Sound_Manager.Sound.None) { Sound_Manager.PlaySound(mouseClickSound); } }; #endif #if CURSOR_MANAGER // Cursor Manager internalOnPointerEnterFunc += () => { if (cursorMouseOver != CursorManager.CursorType.None) { CursorManager.SetCursor(cursorMouseOver); } }; internalOnPointerExitFunc += () => { if (cursorMouseOut != CursorManager.CursorType.None) { CursorManager.SetCursor(cursorMouseOut); } }; #endif }
public override void OnInspectorGUI() { // Grab the script. Sound_Manager myTarget = target as Sound_Manager; // Set the indentLevel to 0 as default (no indent). EditorGUI.indentLevel = 0; // Update serializedObject.Update(); // General Label. EditorGUILayout.LabelField("General", EditorStyles.boldLabel); // Increase the indent. EditorGUI.indentLevel++; // The Background. myTarget.bgMusicSource = EditorGUILayout.ObjectField(new GUIContent("BG Music Source", "The background music AudioSource. Drag the AudioSource in the inspector that is attached to this GameObject to this variable."), myTarget.bgMusicSource, typeof(AudioSource), true) as AudioSource; // Set the layout. EditorGUILayout.PropertyField(serializedObject.FindProperty("musicOn"), new GUIContent("Music On")); EditorGUILayout.PropertyField(serializedObject.FindProperty("sfxOn"), new GUIContent("SFX On")); // The sound volume. myTarget.sfxVolume = EditorGUILayout.Slider(new GUIContent("SFX Volume", "The volume of the sound effects."), myTarget.sfxVolume, 0f, 1f); // Decrease the indent. EditorGUI.indentLevel--; // apply serializedObject.ApplyModifiedProperties(); }
void Start() { UIM = GameObject.FindGameObjectWithTag("UI_Manager").GetComponent <UI_Manager>(); SM = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent <Sound_Manager>(); UIM.UpdateLife(Life); UIM.UpdateScore(0f); }
private void EnemyMain_OnDamaged(object sender, EnemyMain.OnDamagedEventArgs e) { Vector3 bloodDir = (GetPosition() - e.attacker.GetPosition()).normalized; BloodParticleSystemHandler.Instance.SpawnBlood(5, GetPosition(), bloodDir); int damageAmount = Mathf.RoundToInt(30 * e.damageMultiplier * UnityEngine.Random.Range(.8f, 1.2f)); DamagePopup.Create(GetPosition(), damageAmount, false); enemyMain.HealthSystem.Damage(damageAmount); //Sound_Manager.PlaySound(Sound_Manager.Sound.BodyHit_1, GetPosition()); if (enemyMain.HealthSystem.IsDead()) { FlyingBody.Create(GameAssets.i.pfEnemyFlyingBody, GetPosition(), bloodDir); enemyMain.DestroySelf(); Sound_Manager.PlaySound(Sound_Manager.Sound.Minion_Dead, GetPosition()); } else { // Knockback enemyMain.EnemyRigidbody2D.MovePosition(transform.position + bloodDir * 5f); } }
void Start() { GM = GameObject.FindGameObjectWithTag("Game_Manager").GetComponent <Game_Manager>(); SM = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent <Sound_Manager>(); Path = GetComponent <LineRenderer>(); StartX = transform.position.x; }
// Use this for initialization // 점수와 라이프 초기화를 시킨뒤 버거를 생성시킴 void Start() { score = 0; life = 3; makeBuggerStack(); Sound_Manager.PlaySound("sd_game_playing_bgm"); }
void Awake() { gameEnded = false; gameStarted = false; PhotonNetwork.automaticallySyncScene = true; sound_manager = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent<Sound_Manager>(); // gets the sound sources winScreen = GameObject.FindGameObjectWithTag("Win_Screen"); loseScreen = GameObject.FindGameObjectWithTag("Lose_Screen"); }
// Getter, Setter public static Sound_Manager GetInstance() { if (null == m_instance) { m_instance = new Sound_Manager(); } return(m_instance); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); Sound_Manager sm = (Sound_Manager)target; if (GUILayout.Button("Add Sound")) { sm.AddSound(); } }
//넘겨준 인자 만큼 스코어 마이너스 public static void minusLife(int value) { life -= value; Sound_Manager.PlaySound("sd_life_minus"); if (life == 0) { Time.timeScale = 0; SceneManager.LoadScene("[gameover_scene]"); } }
// Randomly declares the part broken or leaves it as its default, inspector set value. void Start() { sceneCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); soundManager = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <Sound_Manager>(); if (canBreak) { CheckBroken(); } }
private IEnumerator RandomCanSound_Routine() { while (true) { yield return(new WaitForSeconds(Random.Range(minMaxDelay.x, minMaxDelay.y))); Sound_Manager soundManager = Sound_Manager.Instance; soundManager.PlayRandomSFX(clips); } }
void Start() { sound_manager = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent<Sound_Manager>().GetInstance(); if (sound_manager.GetInstance() != null) { snapshot_normal = sound_manager.GetInstance().master_mixer.FindSnapshot("Snapshot"); snapshot_attack = sound_manager.GetInstance().master_mixer.FindSnapshot("Snapshot_Attack"); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.GetComponent <Fantome>() != null) { Sound_Manager.Playsound("Eat"); GameControl.instance.FantomeScoreViolet(); Fantome.instance.AnimMange(); anim.SetTrigger("Aspire"); timer = 1; } }
public void Start() { sound_manager = Sound_Manager.instance; foreach (Change ch in GetComponentsInChildren <Change>(true)) { ch.AddEventOnListener(this); } ChangeOnStart(); }
private void Awake() { if (_Instance == null) { _Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
public void ride_car_Init() { str_Game_Mag = Game_Manager.Instance; str_Sound_mag = Sound_Manager.Instance; directionX = .0f; directionY = .0f; move_speed = .0f; //car set. transform.position = new Vector3(-0.42f, -6.8f, -1.0f); }
void OnEnable() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { DestroyImmediate(gameObject); } }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
// Use this for initialization void Start() { myTransform = this.transform; rb = GetComponent <Rigidbody>(); enemy = GameObject.FindGameObjectWithTag("Enemy"); gameManager = GameObject.FindGameObjectWithTag("Game Manager").GetComponent <Game_Manager>(); soundManager = GameObject.FindGameObjectWithTag("Sound Manager").GetComponent <Sound_Manager>(); distToGround = myTransform.GetComponent <Collider>().bounds.extents.y; }
public void Start() { if (snd_mng != null) { snd_mng = Sound_Manager.instance; } glitchHandler.PutObjectInRender(allVisualInteractibleObject); foreach (GameObject gO in allVisualInteractibleObject) { gO.SetActive(false); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.GetComponent <Fantome>() != null) { Sound_Manager.Playsound("GameOver"); GameControl.instance.FantomeMeurt(); Fantome.instance.setEstMortTrue(); Fantome.instance.forceDefaite(); Fantome.instance.AnimMort(); anim.SetTrigger("Intermediaire"); } }
private void ShootTarget() { enemyTarget = enemyMain.EnemyTargeting.GetActiveTarget(); if (enemyTarget != null) { // Shoot! Sound_Manager.PlaySound(Sound_Manager.Sound.Rifle_Fire, GetPosition()); Vector3 targetPosition = enemyTarget.GetPosition(); SetStateAttacking(); fireRate = FIRE_RATE; targetPosition += UtilsClass.GetRandomDir() * UnityEngine.Random.Range(-5f, 15f); aimAnims.ShootTarget(targetPosition, () => { }); } }
private void PlayerSwapAimNormal_OnShoot(object sender, CharacterAim_Base.OnShootEventArgs e) { Shoot_Flash.AddFlash(e.gunEndPointPosition); WeaponTracer.Create(e.gunEndPointPosition, e.shootPosition); UtilsClass.ShakeCamera(.6f, .05f); SpawnBulletShellCasing(e.gunEndPointPosition, e.shootPosition); if (weapon.GetWeaponType() == Weapon.WeaponType.Shotgun) { // Shotgun spread int shotgunShells = 4; for (int i = 0; i < shotgunShells; i++) { WeaponTracer.Create(e.gunEndPointPosition, e.shootPosition + UtilsClass.GetRandomDir() * UnityEngine.Random.Range(-20f, 20f)); if (i % 2 == 0) { SpawnBulletShellCasing(e.gunEndPointPosition, e.shootPosition); } } } switch (weapon.GetWeaponType()) { default: case Weapon.WeaponType.Pistol: Sound_Manager.PlaySound(Sound_Manager.Sound.Pistol_Fire, GetPosition()); break; case Weapon.WeaponType.Rifle: Sound_Manager.PlaySound(Sound_Manager.Sound.Rifle_Fire, GetPosition()); break; case Weapon.WeaponType.Shotgun: Sound_Manager.PlaySound(Sound_Manager.Sound.Shotgun_Fire, GetPosition()); break; } // Any enemy hit? if (e.hitObject != null) { Enemy enemy = e.hitObject.GetComponent <Enemy>(); if (enemy != null) { enemy.Damage(this, weapon.GetDamageMultiplier()); } ShieldFieldTransformer shieldFieldTransformer = e.hitObject.GetComponent <ShieldFieldTransformer>(); if (shieldFieldTransformer != null) { shieldFieldTransformer.Damage(this, weapon.GetDamageMultiplier()); } } }
public void Start_CardSelect() { Global._gameMode = GAME_MODE.CARD_SELECT; Sound_Manager.GetInstance().Stop_Sound(); if (Random.Range(0, 2) == 0) { Sound_Manager.GetInstance().PlaySound("Hearthstone"); } else { Sound_Manager.GetInstance().PlaySound("Hearthstone2"); } DestroyAll(); cardSelect.Start_CardSelect(); }
public void Awake() { if (instance == null) { instance = this; AkSoundEngine.PostEvent(startEvent.Id, instance.gameObject); startEvent.Post(this.gameObject, (uint)callBackToSeek, CallBackFunction); for (int i = 0; i < listInstru.Count; i++) { listInstru[i].gameObjectOfTheInstrument.GetComponentInChildren <MainInstrument>().indexForSoundManager = i; } } else { instance = this; } }
void Start() { str_Event_Mag = Event_Manager.Instance; //사용할때 변수 안쓰고 쓸라면 (Event_Manager.Instance). str_Camera_Mag = Camera_Manager.Instance; str_Character = Character.Instance; str_ride_car = ride_car.Instance; str_sound_Mag = Sound_Manager.Instance; //타 클래스 초기화. str_Event_Mag.Event_Init(); str_Character.Character_Init(); str_ride_car.ride_car_Init(); str_Camera_Mag.Camera_Init(); eat_ice_cream = true; ice_cream = false; trash_check = false; car_check = false; F_key_ = true; ride_car_update = false; ride_car_Evnet = false; char_update = true; trash_Event = false; cross_Event = false; steel_down = false; shoot_ = false; trash_shoot_ = false; dir_con = new Vector3(0, 0, 0); c_distance = .0f; t_distance = .0f; trash_dis = 4.0f; spriteRenderer = GameObject.Find("Player_ice_cream").GetComponent <SpriteRenderer>(); //오브젝트 위치 set obj_trash.transform.position = new Vector3(-5.66f, 3.94f, -1.0f); //background_bgm str_sound_Mag.PlayBGM(1); }
public void Character_Init() { c_move = false; str_Game_mag = Game_Manager.Instance; str_camera_mag = Camera_Manager.Instance; str_sound_mag = Sound_Manager.Instance; //character start postion transform.position = new Vector3(1.29f, -7.62f, -1.0f); //위치 초기화. wall_check[0].transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z); animator = GetComponent <Animator>(); animator.applyRootMotion = false; }
private void Start() { Sound_Manager.Init(); cameraFollow.Setup(GetCameraPosition, () => 60f, true, true); Vector3 pathfindingLowerLeft = transform.Find("PathfindingLowerLeft").position; Vector3 pathfindingUpperRight = transform.Find("PathfindingUpperRight").position; gridPathfinding = new GridPathfinding(pathfindingLowerLeft, pathfindingUpperRight, 5f); //gridPathfinding.RaycastWalkable(1 << GameAssets.i.wallLayer); //gridPathfinding.PrintMap(pfPathfindingWalkable, pfPathfindingUnWalkable); //Enemy enemy = Enemy.Create(player.GetPosition() + new Vector3(+60, 0)); //enemy.EnemyMain.EnemyTargeting.SetGetTarget(() => player); uiWeapon.SetWeapon(player.GetWeapon()); player.OnWeaponChanged += Player_OnWeaponChanged; //FunctionTimer.Create(() => doorAnims.OpenDoor(), 3f); }
// Use this for initialization void Start() { sound_manager = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent<Sound_Manager>(); BGMVolSlider = GameObject.Find("BGM_Vol_Slider"); SEVolSlider = GameObject.Find("SE_Vol_Slider"); //FSToggle = GameObject.Find("FullScreen_Toggle"); //volTest = BGMVolSlider.GetComponent<AudioSource>(); BGMBounds = BGMVolSlider.GetComponent<RectTransform>().rect; BGMBounds.xMin += BGMVolSlider.GetComponent<RectTransform>().position.x; BGMBounds.xMax += BGMVolSlider.GetComponent<RectTransform>().position.x; BGMBounds.yMin += BGMVolSlider.GetComponent<RectTransform>().position.y; BGMBounds.yMax += BGMVolSlider.GetComponent<RectTransform>().position.y; SEBounds = SEVolSlider.GetComponent<RectTransform>().rect; SEBounds.xMin += SEVolSlider.GetComponent<RectTransform>().position.x; SEBounds.xMax += SEVolSlider.GetComponent<RectTransform>().position.x; SEBounds.yMin += SEVolSlider.GetComponent<RectTransform>().position.y; SEBounds.yMax += SEVolSlider.GetComponent<RectTransform>().position.y; //make fullscreen }
void Start() { m_baseCell.isMine = false; m_baseCell.isAIPossessed = true; m_baseCell.isDepleting = false; m_baseCell.currentProtein *= 0.5f; // lower enemy power m_baseCell.tag = "EnemyCell"; m_baseCell.gameObject.layer = LayerMask.NameToLayer("EnemyCell"); m_baseCell.SetSpeed(m_baseCell.navAgent.speed * .5f); m_baseCell.currentState = CellState.IDLE; if (GetComponent<FogOfWarHider>() == null) gameObject.AddComponent<FogOfWarHider>(); if (GetComponent<FogOfWarViewer>() != null) Destroy(GetComponent<FogOfWarViewer>()); GameObject.Find("PlayerControl").GetComponent<PlayerController>().RemoveDeadCell(m_baseCell); GameObject.Find("PlayerControl").GetComponent<PlayerController>().AddNewCell(m_baseCell); sound_manager = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent<Sound_Manager>().GetInstance(); sound_manager.GetInstance().master_mixer.FindSnapshot("Snapshot_Attack").TransitionTo(3.0f); if (!sound_manager.GetInstance().battle_music.isPlaying) { sound_manager.GetInstance().battle_music.Play(); } }
protected void bAwake() { sound_manager = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent<Sound_Manager>().GetInstance(); navAgent = GetComponent<NavMeshAgent>(); navObstacle = GetComponent<NavMeshObstacle>(); navAgent.speed = moveSpeed; pcontroller = GameObject.Find("PlayerControl").GetComponent<PlayerController>(); if (PhotonNetwork.connected) { isSinglePlayer = (bool)photonView.instantiationData[0]; } else { isSinglePlayer = true; } depleteTimer = DEPLETE_TIME; if (isSinglePlayer) { // GetComponent<PhotonView>().enabled = false; } else { isMine = photonView.isMine; } if (isMine) { gameObject.AddComponent<FogOfWarViewer>(); } else if (!isMine && isAIPossessed) { gameObject.AddComponent<FogOfWarHider>(); } else if (!isMine) { gameObject.AddComponent<FogOfWarHider>(); } pcontroller.AddNewCell(this); }
//private AudioMixerSnapshot snapshot_normal; //private AudioMixerSnapshot snapshot_muted; // Use this for initialization void Start() { if (this == instance) { return; } // singleton check and creation for the sound manager. if (instance == null) { lock (single_lock) { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else DestroyObject(gameObject); } } if (!instance.backGround_music.isPlaying) { instance.backGround_music.Play(); } // mute_button = GameObject.FindGameObjectWithTag("Mute_Button").GetComponent<Button>(); // backGround_music.Play(); // snapshot_muted = Sound_Manager.instance.GetComponent<AudioMixerSnapshot>().audioMixer.FindSnapshot("Snapshot_muted"); // snapshot_muted = Sound_Manager.instance.snapshot_muted.TransitionTo(3.0f); //snapshot_muted = instance.master_mixer.FindSnapshot("Snapshot_muted"); //snapshot_normal = instance.master_mixer.FindSnapshot("Snapshot"); DontDestroyOnLoad(instance); }
void Awake() { Time.timeScale = 1.0f; sound_manager = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent<Sound_Manager>(); // gets the sound sources winScreen = GameObject.FindGameObjectWithTag("Win_Screen"); loseScreen = GameObject.FindGameObjectWithTag("Lose_Screen"); Hud_Canvas = GameObject.FindGameObjectWithTag("HUD_Canvas"); winScreen.SetActive(false); loseScreen.SetActive(false); button_split = GameObject.FindGameObjectWithTag("Button_Split").GetComponent<Button>(); button_devolve = GameObject.FindGameObjectWithTag("Button_Devolve").GetComponent<Button>(); button_merge = GameObject.FindGameObjectWithTag("Button_Merge").GetComponent<Button>(); button_evolve = GameObject.FindGameObjectWithTag("Button_Evolve").GetComponent<Button>(); button_split.interactable = false; button_devolve.interactable = false; button_merge.interactable = false; button_evolve.interactable = false; minimapCamera = GameObject.FindGameObjectWithTag("Minimap_Camera").GetComponent<Camera>(); touchButton = GameObject.Find("Touch"); if (!Input.touchSupported) { GameObject.Find("RIGHT_CLICK_Panel").SetActive(false); isSelecting = false; } terrainLayer = 1 << LayerMask.NameToLayer("Terrain"); // Layer masking for raycast clicking // ---------- }
public override void Awake() { base.Awake(); sound_manager = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent<Sound_Manager>(); }