protected virtual void SetPositionTarget(VRTK_BaseControllable obj, float newTarget) { if (obj.GetType() == typeof(VRTK_PhysicsPusher)) { VRTK_PhysicsPusher physicsObj = obj as VRTK_PhysicsPusher; physicsObj.positionTarget = newTarget; } else if (obj.GetType() == typeof(VRTK_ArtificialPusher)) { VRTK_ArtificialPusher artificialObj = obj as VRTK_ArtificialPusher; artificialObj.SetPositionTarget(newTarget); } }
protected virtual void SetStayPressed(VRTK_BaseControllable obj, bool state) { if (obj.GetType() == typeof(VRTK_PhysicsPusher)) { VRTK_PhysicsPusher physicsObj = obj as VRTK_PhysicsPusher; physicsObj.stayPressed = state; } else if (obj.GetType() == typeof(VRTK_ArtificialPusher)) { VRTK_ArtificialPusher artificialObj = obj as VRTK_ArtificialPusher; artificialObj.SetStayPressed(state); } }