//private void FixedUpdate() //{ // if(!fallenInLine){ // if (timeToFallInLine > 0) // { // timeToFallInLine -= Time.fixedDeltaTime; // }else if(frontFish != null) // { // GetComponent<HingeJoint>().connectedBody = frontFish.GetComponent<Rigidbody>(); // GetComponent<Collider>().enabled = true; // fallenInLine = true; // } // } //} public void SetInk(avaliableColors newInk) { inkBox = FindObjectOfType <InkBox>(); ink = newInk; Color newColor = inkBox.colors[newInk]; GetComponent <Light>().color = newColor; MeshRenderer[] emittingMeshes = GetComponentsInChildren <MeshRenderer>(); foreach (MeshRenderer mesh in emittingMeshes) { if (mesh.gameObject.CompareTag("Emitting")) { mesh.material.SetColor("_EmissionColor", newColor); } } }
private void Start() { player = FindObjectOfType <PlayerController>(); inkBox = FindObjectOfType <InkBox>(); }
private void Start() { inkBox = FindObjectOfType <InkBox>(); rigidbody = gameObject.GetComponent <Rigidbody>(); SetInk(ink); }