Beispiel #1
0
    void Start()
    {
        //Find references
        toolbox = FindObjectOfType <Toolbox>();
        if (toolbox == null)
        {
            Debug.LogError("toolbox not found!!!");
        }
        em          = toolbox.GetComponent <EventManager>();
        gameManager = toolbox.GetComponent <GameManager>();
        Transform respawnPointHolder = transform.
                                       GetComponentInChildren <RespawnPointHolderTag>().transform;

        foreach (Transform child in respawnPointHolder)
        {
            respawnPoints.Add(child);
        }

        Transform powerUpPositionHolder = transform.
                                          GetComponentInChildren <PowerUpPositionsHolderTag>().transform;

        foreach (Transform child in powerUpPositionHolder)
        {
            powerUpPositions.Add(child);
        }

        //Find globalVariableLibrary and get variables from it
        lib = toolbox.GetComponent <GlobalVariableLibrary>();
        GetStats();

        //Send respawnPoint list to GameManager and broadcast NewSceneLoaded
        gameManager.SetRespawnPoints(respawnPoints);
        gameManager.SetPowerUpPositions(powerUpPositions);
        em.BroadcastNewSceneLoaded(mySceneIndex);
    }
Beispiel #2
0
 void Awake()
 {
     toolbox         = FindObjectOfType <Toolbox>();
     em              = toolbox.GetComponent <EventManager>();
     lib             = toolbox.GetComponent <GlobalVariableLibrary>();
     shipInfoManager = toolbox.GetComponent <ShipInfoManager>();
     GetStats();
 }
Beispiel #3
0
 private void Awake()
 {
     toolbox = FindObjectOfType <Toolbox>();
     em      = toolbox.GetComponent <EventManager>();
     lib     = toolbox.GetComponent <GlobalVariableLibrary>();
     rb      = GetComponent <Rigidbody>();
     GetStats();
 }
Beispiel #4
0
    void Awake()
    {
        toolbox = FindObjectOfType <Toolbox>();
        em      = toolbox.GetComponentInChildren <EventManager>();
        lib     = toolbox.GetComponent <GlobalVariableLibrary>();
        GetStats();

        cameraParent = transform.parent;
    }
Beispiel #5
0
    private void Awake()
    {
        serverState = ServerState.DEFAULT;

        toolbox         = FindObjectOfType <Toolbox>();
        em              = toolbox.GetComponent <EventManager>();
        lib             = toolbox.GetComponent <GlobalVariableLibrary>();
        shipInfoManager = toolbox.GetComponent <ShipInfoManager>();
        GetStats();
    }
Beispiel #6
0
    private void Awake()
    {
        toolbox = FindObjectOfType <Toolbox>();
        em      = toolbox.GetComponent <EventManager>();
        lib     = toolbox.GetComponent <GlobalVariableLibrary>();
        powerUpPlatformEffect   = transform.GetChild(1).GetComponent <ParticleSystem>();
        powerUpPickupEffect     = transform.GetChild(2).GetComponent <ParticleSystem>();
        powerUpObject           = GetComponentInChildren <PowerUpAnimator>().gameObject;
        powerUpPlatformCollider = transform.GetComponent <Collider>();

        GetStats();
    }
Beispiel #7
0
    void Start()
    {
        toolbox = FindObjectOfType <Toolbox>();
        if (toolbox == null)
        {
            Debug.LogError("toolbox not found!!!");
        }
        em  = toolbox.GetComponent <EventManager>();
        lib = toolbox.GetComponent <GlobalVariableLibrary>();
        GetStats();

        em.BroadcastNewSceneLoaded(mySceneIndex);
    }
Beispiel #8
0
        void Awake()
        {
            toolbox         = FindObjectOfType <Toolbox>();
            em              = toolbox.GetComponent <EventManager>();
            lib             = toolbox.GetComponent <GlobalVariableLibrary>();
            shipInfoManager = toolbox.GetComponent <ShipInfoManager>();
            GetStats();

            if (networkFunctionalityDisabled)
            {
                this.enabled = false;
            }
        }
Beispiel #9
0
 protected virtual void Awake()
 {
     toolbox            = FindObjectOfType <Toolbox>();
     em                 = toolbox.GetComponent <EventManager>();
     lib                = toolbox.GetComponentInChildren <GlobalVariableLibrary>();
     shipInfoManager    = toolbox.GetComponent <ShipInfoManager>();
     rb                 = GetComponent <Rigidbody>();
     shipColorableParts = GetComponentsInChildren <ShipColorablePartTag>();
     shipHull           = GetComponentInChildren <ShipHullTag>().transform;
     shipTurret         = GetComponentInChildren <ShipTurretTag>().transform;
     turretOutputMarker = GetComponentInChildren <TurretOutputMarkerTag>().
                          transform;
     healthBar = GetComponentInChildren <ShipHealthBarTag>().gameObject;
 }
    private void Awake()
    {
        #region Singletonization
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
        #endregion
    }
Beispiel #11
0
    void Awake()
    {
        #region Singletonization
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
        #endregion

        toolbox = FindObjectOfType <Toolbox>();
        em      = toolbox.GetComponent <EventManager>();
        lib     = toolbox.GetComponent <GlobalVariableLibrary>();
        GetStats();
    }