コード例 #1
0
        void Awake()
        {
            DontDestroyOnLoad(this);

            EventManager.StartListening(GlobalEvents.PlayerDead, OnplayerDeath);
            EventManager.StartListening(GlobalEvents.BossDead, OnMissionSuccess);
            EventManager.StartListening(GlobalEvents.PointsEarned, UpdatePlayerPoints);
            EventManager.StartListening(GlobalEvents.MissionStartRequest, StartMission);

            playerGameObject   = Instantiate(Resources.Load("Player")) as GameObject;
            playerDeathManager = playerGameObject.GetComponentInChildren <PlayerDeathManager>();
            playerGameObject.SetActive(false);
            playerGameObject.transform.SetParent(transform);

            gameplayCamera = Instantiate(gameplayCameraPrefab);
            gameplayCamera.transform.SetParent(transform);

            //FIXME  you know what
            playerTransform = playerGameObject.transform.GetChild(0).transform;
            if (!playerTransform)
            {
                print("FAIL");
            }

            dialog = UIManager.Instance.Dialog;
        }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: vicky1408/Gambador
 private void DestroyAllManagers()
 {
     // define your services here
     CameraManager       = null;
     RaycastManager      = null;
     EnemyManager        = null;
     AttackManager       = null;
     MovingPlayerManager = null;
     CursorManager       = null;
     SoundManager        = null;
     PlayerDeathManager  = null;
 }
コード例 #3
0
    // Start is called before the first frame update
    void Start()
    {
        Time.timeScale = 1;
        GameObject gameManager = GameObject.Find("GameManager");

        soundManager       = gameManager.GetComponent <SoundManager>();
        playerDeathManager = GetComponent <PlayerDeathManager>();
        rb           = this.gameObject.GetComponent <Rigidbody2D>();
        color        = 0;
        actualBullet = bulletWhite;
        speedSlow    = speed / 3;

        for (int i = 0; i <= 4; i++)
        {
            shooterTransform[i] = shooters[i].transform;
        }
    }
コード例 #4
0
ファイル: GameManager.cs プロジェクト: vicky1408/Gambador
    private void StartGameManager()
    {
        try
        {
            // define your services here

            RaycastManager      = new RaycastManager();
            EnemyManager        = new EnemyManager();
            AttackManager       = new AttackManager();
            MovingPlayerManager = new MovingPlayerManager("Player");
            CursorManager       = new CursorManager();
            SoundManager        = new SoundManager();
            PlayerDeathManager  = new PlayerDeathManager();
            CameraManager       = new CameraManager("Main Camera");

            SFXManager.SetSfx();
        }
        catch (Exception e)
        {
            Debug.LogException(e);
        }
    }