public override void OnSelected(Hand hand) { isBuilding = true; objInstance = Instantiate(objectToPlace); buildingCollider = objInstance.GetComponentInChildren <Collider>(); handSelector = hand.GetComponentInChildren <HandSelector>(); selectedHand = hand; }
private void ChangeAllColors(Color color) { var mats = objInstance.GetComponentInChildren <MeshRenderer>().materials; foreach (var mat in mats) { mat.SetColor("_Color", color); } }