更改文件架构

This commit is contained in:
CortexCore
2023-06-07 18:38:07 +08:00
parent 93292b1a59
commit ed84166723
720 changed files with 297 additions and 65 deletions

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class LocationAdditive : BITBehavior
{
Vector3 currentPosition;
Vector3 currentEulur;
public void AddPosition(Vector3 value)
{
currentPosition += value;
}
public void AddEuler(Vector3 value)
{
currentEulur += value;
}
public void LateUpdate()
{
if (currentEulur.IsDefault() is false)
{
transform.localEulerAngles = currentEulur;
currentEulur = default;
}
if (currentPosition.IsDefault() is false)
{
transform.localPosition = currentPosition;
currentPosition = default;
}
}
}
}

View File

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

View File

@@ -0,0 +1,40 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class LocationMixer : BITBehavior
{
[System.Serializable]
struct LocationInfo
{
public Location location;
public float weight;
}
[SerializeField] Dictionary<int, LocationInfo> locations = new();
public void SetLocation(Location location, int index = 0, float weight = 0)
{
locations.Set(index, new()
{
location = location,
weight = weight
});
}
void LateUpdate()
{
Location currentLocation = new();
locations.ForEach(x =>
{
if (x.Key is 0)
{
currentLocation = x.Value.location * x.Value.weight;
}
else
{
currentLocation=Location.Lerp(currentLocation,x.Value.location,x.Value.weight);
}
});
transform.SetPositionAndRotation(currentLocation, currentLocation);
}
}
}

View File

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