Merge branch 'master' of ooftooft.net:Racesm

This commit is contained in:
2024-04-19 16:07:29 +02:00
123 changed files with 23513 additions and 704 deletions

71
Assets/Scripts/NPC.cs Normal file
View File

@@ -0,0 +1,71 @@
using System.Collections;
using System.Collections.Generic;
using Unity.MLAgents.SideChannels;
using UnityEngine;
public class NPC : MonoBehaviour
{
private Rigidbody[] RBchildren;
// Start is called before the first frame update
void Start()
{
foreach (Transform g in transform.GetComponentsInChildren<Transform>())
{
try
{
var rb = g.GetComponent<Rigidbody>();
rb.useGravity = false;
}
catch (System.Exception)
{
continue;
}
}
// for (int i = 0; i < RBchildren.Length; i++)
// {
// RBchildren[i].useGravity = false;
// }
}
// Update is called once per frame
void Update()
{
}
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Player")
{
foreach (Transform g in transform.GetComponentsInChildren<Transform>())
{
try
{
var rb = g.GetComponent<Rigidbody>();
rb.useGravity = true;
rb.isKinematic = false;
}
catch (System.Exception)
{
continue;
}
}
}
// for (int i = 0; i < RBchildren.Length; i++)
// {
// RBchildren[i].useGravity = true;
// RBchildren[i].isKinematic = false;
// }
}
}

View File

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