BasicAction GetSecondaryAction(InteractableRaw thisInteractable, InteractorRaw interactor) { BasicAction action = null; switch (secondary) { case SecondGrab.None: action = new NothingAction(thisInteractable, interactor); break; case SecondGrab.Switch: action = new SwitchAction(thisInteractable, interactor); break; case SecondGrab.Scale: break; case SecondGrab.LookAt: var updateType = followType == FollowType.Transform ? UpdateEvents.BeforeRender : UpdateEvents.FixedUpdate; action = new LookAtAction(thisInteractable, interactor, ((FollowAction)grab.grabbedObjects[0].action).offset, true, updateType); break; } return(action); }
protected override void OnEnable() { base.OnEnable(); m_LookAtAction = (LookAtAction)m_Action; m_LookAtProp = serializedObject.FindProperty("m_LookAt"); m_TransformModeTransformProp = serializedObject.FindProperty("m_TransformModeTransform"); m_SpeedProp = serializedObject.FindProperty("m_Speed"); m_RotateProp = serializedObject.FindProperty("m_Rotate"); }