예제 #1
0
 private void Start()
 {
     _bgmSource.clip = _bgm;
     _bgmSource.loop = true;
     _bgmSource.Play();
     _gameSequencer = GetComponent <GameSequencer>();
     _gameSequencer.OnAcquireMoney += () => { _seSource.PlayOneShot(_acquireMoney); };
     _gameSequencer.OnEndGame      += () => { _seSource.PlayOneShot(_shotSE); };
 }
예제 #2
0
    void Awake()
    {
        m_gameManager   = GameObject.Find("GameManager").GetComponent <GameManager>();
        m_gameSequencer = GameObject.Find("GameSequencer").GetComponent <GameSequencer>();

        m_ballTransform = GameObject.Find("Ball").transform;
        m_ballMover     = GameObject.Find("Ball").GetComponent <BallMover>();
        m_ballSfx       = GameObject.Find("Ball").GetComponent <AudioSource>();
        m_sfxHit        = Resources.Load("hitball") as AudioClip;
        m_sfxSmash      = Resources.Load("smashball") as AudioClip;

        m_particles   = GetComponentInChildren <ParticleSystem>();
        m_gfxAnimator = GetComponentInChildren <Animator>();
    }
예제 #3
0
    void Start()
    {
        m_gameSequencer = GameObject.Find("GameSequencer").GetComponent <GameSequencer>();

        if (transform.position.x < 0)
        {
            m_defendingPlayer = PlayerIds.P1;
            m_scoringPlayer   = PlayerIds.P2;
        }
        else
        {
            m_defendingPlayer = PlayerIds.P2;
            m_scoringPlayer   = PlayerIds.P1;
        }
    }
예제 #4
0
    void Awake()
    {
        instance        = this;
        m_uIManager     = GameObject.Find("UIManager").GetComponent <UIManager>();
        m_gameSequencer = GameObject.Find("GameSequencer").GetComponent <GameSequencer>();
        m_TouchManager  = GameObject.Find("TouchManager").GetComponent <TouchManager>();
        m_leftGoal      = GameObject.Find("Left Goal").GetComponent <Goal>();
        m_rightGoal     = GameObject.Find("Right Goal").GetComponent <Goal>();

        m_upperBound = Camera.main.orthographicSize;
        m_lowerBound = -m_upperBound;
        m_rightBound = (float)Screen.width / (float)Screen.height * Camera.main.orthographicSize;
        Debug.Log(Screen.width.ToString() + " / " + Screen.height.ToString() + " x " + Camera.main.orthographicSize.ToString());
        Debug.Log(m_rightBound.ToString());
        m_leftBound = -m_rightBound;

        DetermineTouchAreaSize();
        SetGoalsPosition();
        //Debug.Log("[GameManager] Upper Bound (" + m_upperBound.ToString() + "), Lower Bound (" + m_lowerBound.ToString() + ")");
    }
예제 #5
0
 private void Awake()
 {
     Instance = this;
 }