void Start() { this.cameraControler = this.gameObject.AddComponent<CameraControler> (); this.doorController = this.gameObject.AddComponent<DoorController> (); this.inventory = this.gameObject.AddComponent<Inventory> (); this.lightManager = this.gameObject.AddComponent<LightManager> (); this.playerController = this.gameObject.AddComponent<PlayerController> (); this.cameraControler.lightManager = this.lightManager; this.gameObject.name = "Player"; }
void Start() { x = Random.Range(-velocityMax, velocityMax); y = Random.Range(-velocityMax, velocityMax); xMax = transform.localPosition.x + xMax; yMax = transform.localPosition.y + yMax; xMin = transform.localPosition.x + xMin; yMin = transform.localPosition.y + yMin; volume = 0.5f; lm = GameObject.Find("Point light").GetComponent<LightManager>(); }
public override IEnumerable<IDependency> GetDependencies() { yield return new Dependency<Handle<Model>>(OnModelAdded, item => m_Models.Remove(item)); yield return new Dependency<Handle<VertexBufferResource<VertexPositionNormalTexture>>>(item => m_Meshes.Add(item), item => m_Meshes.Remove(item)); yield return new Dependency<Handle<UserVertexResource<VertexPositionNormalTexture>>>(item => m_Meshes.Add(item), item => m_Meshes.Remove(item)); yield return new Dependency<LightManager>(item => m_LightManager = item); }
// Use this for initialization void Awake() { setShown(false); _lightManager = FindObjectOfType<LightManager>(); mainScreenAnimator = transform.FindChild("MainScreen").GetComponent<Animator>(); }
private void Awake() { _lightManager = Object.FindObjectOfType(typeof(LightManager)) as LightManager; print(_lightManager); }