예제 #1
0
    public void RemoveSfx(SfxController sfx)
    {
        sfx.gameObject.SetActive(false);
        //해당 풀로 반환
        var pool = m_sfxPool[sfx.m_type];

        pool.Set(sfx);
    }
예제 #2
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #3
0
 private void Awake()
 {
     if (singleton == null)
     {
         singleton = this;
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
예제 #4
0
 public void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     if (SfxController.instance == null)
     {
         instance = this;
     }
     else if (this != instance)
     {
         Destroy(this.gameObject);
     }
 }
예제 #5
0
    // Start is called before the first frame update
    void Start()
    {
        playerController          = GameObject.Find("Player").GetComponent <PlayerController>();
        playerData                = GameObject.Find("PlayerData").GetComponent <PlayerData>();
        playerLives               = playerData.Lives;
        currentGameLevel          = playerData.CurrentGameLevel;
        playerData.TotalGameLevel = TotalGameLevel;

        bgmController = GameObject.Find("BGM").GetComponent <BgmController>();
        sfxController = GameObject.Find("SFX").GetComponent <SfxController>();

        livesText.text  = "" + playerLives;
        scoreText.text  = "" + playerData.Score;
        IsGameOver      = false;
        IsGamePaused    = false;
        IsLevelComplete = false;
    }
예제 #6
0
    // Start is called before the first frame update
    void Start()
    {
        UseUserInput  = true;
        KeepLowBounce = false;

        gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
        stage       = GameObject.Find("Stage");
        if (horse != null)
        {
            horseCs = horse.GetComponent <Horse>();
        }
        sfxController = GameObject.Find("SFX").GetComponent <SfxController>();
        mainCamera    = GameObject.Find("Main Camera").GetComponent <Camera>();

        rbPlayer       = GetComponent <Rigidbody>();
        playerAnim     = GetComponent <Animator>();
        playerCollider = GetComponent <CapsuleCollider>();

        colliderHeight = playerCollider.height;
        startPos       = transform.position;
    }
예제 #7
0
 // Start is called before the first frame update
 void Start()
 {
     playerController = GameObject.Find("Player").GetComponent <PlayerController>();
     sfxController    = GameObject.Find("SFX").GetComponent <SfxController>();
 }
 void Start()
 {
     m_sfxController = GetComponent <SfxController>();
     m_particles     = GetComponentsInChildren <ParticleSystem>();
 }