void Start() { audioSourceComponent = GetComponent <AudioSource>(); animatorComponent = GetComponent <Animator>(); dissolveScript = GetComponent <DissolveScript>(); currState = State.idle; StartCoroutine(ShootProjectileCoroutine()); }
void Start() { rotationAngle = new Vector3(Random.Range(0, 10), Random.Range(0, 10), Random.Range(0, 10)); GetComponent <Rigidbody>().drag = Random.Range(0.5f, 0.1f); rotationSpeed = Random.Range(1, 5); if (useSpawnPoint) { dissolve = GetComponent <DissolveScript>(); } }
void Start() { isRage = false; moving = true; playerPosition = GameObject.Find("GlobalManager").GetComponent <GlobalManager>().GetPlayerPosition(); animatorComponent = GetComponentInParent <Animator>(); dissolveScript = GetComponent <DissolveScript>(); currState = State.Run; animatorComponent.SetBool("Walk", true); UpdatebuyerCentrePoint(); }
private void Start() { dissolve = GetComponent <DissolveScript>(); }
// Returns whether the dimension changed or not public bool ChangeDimension(Constants.Color color, bool forcefield = false) { if (LevelManager.Instance().isLevelComplete) { return(false); } Constants.Color oldDimension = currentDimension; List <GameObject> objects = LevelManager.Instance().GetLevelObjects(); foreach (GameObject obj in objects) { if (obj.tag == "DestroyOnLoad") { obj.GetComponent <MeshRenderer>().enabled = true; } } switch (color) { case Constants.Color.None: foreach (GameObject obj in objects) { if (obj.tag == "DestroyOnLoad") { obj.GetComponent <MeshRenderer>().enabled = false; } } layers = new string[] { "Default", "Ground" }; break; case Constants.Color.White: { layers = new string[] { "Default", "Ground" }; break; } case Constants.Color.Red: case Constants.Color.Blue: case Constants.Color.Green: { layers = new string[] { "Default", "Ground", "White", color.ToString() }; break; } default: { break; } } PlayerMovement.Instance().groundMask = LayerMask.GetMask(layers); // Don't change current dimension when we are entering the forcefield if (color != Constants.Color.White) { currentDimension = color; } if (forcefield) { foreach (GameObject obj in objects) { Interactable interactable = obj.GetComponent <Interactable>(); if (interactable) { bool objectVisible = (interactable.color == Constants.Color.White || interactable.color == Constants.Color.None || interactable.color == color || color == Constants.Color.White) && color != Constants.Color.None; Physics.IgnoreCollision(obj.GetComponent <Collider>(), PlayerStateManager.Instance().gameObject.GetComponent <CharacterController>(), !objectVisible); DissolveScript dissolve = obj.GetComponent <DissolveScript>(); if (dissolve) { dissolve.SetDissolve(!objectVisible); } } } } if (color != Constants.Color.White) { foreach (ProfileContainer container in profileContainers) { if (container.dimension == currentDimension) { mainCamera.GetComponent <PostProcessVolume>().profile = container.profile; mainCamera.GetComponent <Skybox>().material = container.skybox; break; } } } return(oldDimension != color); }