Initialer Upload neues Unity-Projekt

This commit is contained in:
Daniel Ocks
2025-07-21 09:11:14 +02:00
commit eeca72985b
14558 changed files with 1508140 additions and 0 deletions

View File

@ -0,0 +1,90 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* Licensed under the Oculus SDK License Agreement (the "License");
* you may not use the Oculus SDK except in compliance with the License,
* which is provided at the time of installation or download, or which
* otherwise accompanies this software in either electronic or hard copy form.
*
* You may obtain a copy of the License at
*
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Oculus SDK
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace OculusSampleFramework
{
public class DistanceGrabberSample : MonoBehaviour
{
bool useSpherecast = false;
bool allowGrabThroughWalls = false;
public bool UseSpherecast
{
get { return useSpherecast; }
set
{
useSpherecast = value;
for (int i = 0; i < m_grabbers.Length; ++i)
{
m_grabbers[i].UseSpherecast = useSpherecast;
}
}
}
public bool AllowGrabThroughWalls
{
get { return allowGrabThroughWalls; }
set
{
allowGrabThroughWalls = value;
for (int i = 0; i < m_grabbers.Length; ++i)
{
m_grabbers[i].m_preventGrabThroughWalls = !allowGrabThroughWalls;
}
}
}
[SerializeField]
DistanceGrabber[] m_grabbers = null;
// Use this for initialization
void Start()
{
DebugUIBuilder.instance.AddLabel("Distance Grab Sample");
DebugUIBuilder.instance.AddToggle("Use Spherecasting", ToggleSphereCasting, useSpherecast);
DebugUIBuilder.instance.AddToggle("Grab Through Walls", ToggleGrabThroughWalls, allowGrabThroughWalls);
DebugUIBuilder.instance.Show();
// Forcing physics tick rate to match game frame rate, for improved physics in this sample.
// See comment in OVRGrabber.Update for more information.
float freq = OVRManager.display.displayFrequency;
if (freq > 0.1f)
{
Debug.Log("Setting Time.fixedDeltaTime to: " + (1.0f / freq));
Time.fixedDeltaTime = 1.0f / freq;
}
}
public void ToggleSphereCasting(Toggle t)
{
UseSpherecast = !UseSpherecast;
}
public void ToggleGrabThroughWalls(Toggle t)
{
AllowGrabThroughWalls = !AllowGrabThroughWalls;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b4138e8f8ee53464d80d2449b3b23092
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: