// Use this for initialization void Start() { instance = this; for (int i = 0; i < poolAmount; i++) { GameObject go = (GameObject) Instantiate(pooledObject,transform.position,transform.rotation); go.SetActive(false); pooledObjects.Add(go); } }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; } DontDestroyOnLoad(this); }
void Awake() { m_Player = Instantiate(m_PlayerPrefab.transform, m_LevelPart[0].LevelTransform.transform.position, Quaternion.identity); m_CharacterController = m_Player.GetComponent <CharacterController>(); m_ParticlePooling = GameObject.Find("ParticlePooling").GetComponent <ParticlePooling>(); m_levelPartsInstantiate = new LevelPart[m_LevelPart.Length * m_nbPart]; UnityEngine.Random.InitState(GameObject.Find("seed").GetComponent <Seed>().seed); InstantiateLevelPart(); SpawnFirstParts(); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; } DontDestroyOnLoad(this); typeInstantiateMap[typeof(ProjectileData)] = particleInstantiate; typeInstantiateMap[typeof(ProjectileEvolutiveData)] = particleInstantiateEvolutive; typeInstantiateMap[typeof(ProjectileGuidedData)] = particleInstantiateHoming; typeKillMap[typeof(ProjectileData)] = destroyParticle; typeKillMap[typeof(ProjectileEvolutiveData)] = destroyEvolutive; typeKillMap[typeof(ProjectileGuidedData)] = destroyHoming; }
private void Awake() { m_ParticlePooling = GameObject.Find("ParticlePooling").GetComponent <ParticlePooling>(); }