private void TriggerAnimation(FinchController controller, FinchControllerElement element, GameObject model) { if (controller.GetPressDown(element)) { model.transform.localPosition = new Vector3(0, 0, 0.021f); } else if (controller.GetPressUp(element)) { model.transform.localPosition = new Vector3(0, 0, 0); } }
private void HandleMaterialChange(FinchController controller, MeshRenderer Renderer, int materialIndex, Material pressed, Material unpressed, FinchControllerElement element) { if (controller.GetPressDown(element)) { Material[] arrayCopy = Renderer.materials; arrayCopy[materialIndex] = pressed; Renderer.materials = arrayCopy; } else if (controller.GetPressUp(element)) { Material[] arrayCopy = Renderer.materials; arrayCopy[materialIndex] = unpressed; Renderer.materials = arrayCopy; } }