Example #1
0
    void Awake()
    {
        if (g == null)
        {
            g = this;
        }
        else
        {
            Destroy(this);
        }
        _world             = new TileType[_dims.x, _dims.y];
        _entityMap         = new List <WorldEntity> [_dims.x, _dims.y];
        mapEditor          = gameObject.GetComponent <MapEditor>();
        checkPointsManager = gameObject.GetComponent <CheckPointsManager>();
        // Char1 = Char1Object.GetComponent<Character>();
        // Char2 = Char2Object.GetComponent<Character>();
        // CharCombined = CharCombinedObject.GetComponent<Character>();
        char1Entity        = Char1Object.GetComponent <WorldEntity>();
        char2Entity        = Char2Object.GetComponent <WorldEntity>();
        charCombinedEntity = CharCombinedObject.GetComponent <WorldEntity>();
        // Char1Object.SetActive(true);
        // Char2Object.SetActive(true);
        // CharCombinedObject.SetActive(false);
        //_camera = _mainCamera.GetComponent<Camera>();

        //LoadLevel(1);

        // InstantiateDoor(new IntVector(4, 5), ID: 1, triggerNumber: 1);
        // InstantiateStepTrigger(new IntVector(4, 4), ID: 1);
        // InstantiateStayTrigger(new IntVector(9, 5), ID: 1);
    }
Example #2
0
 void Start()
 {
     m_GameOverScript             = m_GameOverCanvas.GetComponent <GameOverMenuScript>();
     m_MainPlayerScript           = m_MainPlayer.GetComponent <MainPlayerScript>();
     m_MainPlayerScript.GameOver += GameOver; //Subscribe as a listener to the GameOver event
     m_EnemiesManagerScript       = m_EnemyManager.GetComponent <EnemiesManager>();
     m_CheckPointManagerScript    = m_CheckPointsParentObject.GetComponent <CheckPointsManager>();
     m_GameCompletedAudioSource   = GetComponent <AudioSource>();
 }
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            instance = this;
        }

        checkPointList = new List <CheckPoint>();
        enemyList      = new List <Enemy>();
        playerList     = new List <GameObject>();
    }
Example #4
0
 void Awake()
 {
     checkPointsManager = gameObject.GetComponent <CheckPointsManager>();
 }