mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-22 01:25:12 +00:00
I'm tired
This commit is contained in:
parent
606ad902e7
commit
d88a5614ec
79 changed files with 9627 additions and 17 deletions
8
Assets/Plugins/NaughtyBezierCurves.meta
Normal file
8
Assets/Plugins/NaughtyBezierCurves.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1461a30a14788b747afa2c0425a4deb2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Plugins/NaughtyBezierCurves/LICENSE.md
Normal file
22
Assets/Plugins/NaughtyBezierCurves/LICENSE.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Denis Rizov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
7
Assets/Plugins/NaughtyBezierCurves/LICENSE.md.meta
Normal file
7
Assets/Plugins/NaughtyBezierCurves/LICENSE.md.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ee6091e228b420e45a05986471184a58
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Plugins/NaughtyBezierCurves/Prefabs.meta
Normal file
9
Assets/Plugins/NaughtyBezierCurves/Prefabs.meta
Normal file
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fe21a9ea4ec856042a1248801c9528e0
|
||||
folderAsset: yes
|
||||
timeCreated: 1440000563
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
152
Assets/Plugins/NaughtyBezierCurves/Prefabs/Bezier Curve.prefab
Normal file
152
Assets/Plugins/NaughtyBezierCurves/Prefabs/Bezier Curve.prefab
Normal file
|
@ -0,0 +1,152 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &103546
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 483646}
|
||||
- 114: {fileID: 11476518}
|
||||
m_Layer: 0
|
||||
m_Name: Bezier Curve
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &109056
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 431134}
|
||||
- 114: {fileID: 11403396}
|
||||
m_Layer: 0
|
||||
m_Name: Point 1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &130974
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 448922}
|
||||
- 114: {fileID: 11438208}
|
||||
m_Layer: 0
|
||||
m_Name: Point 0
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &431134
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 109056}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 1, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 483646}
|
||||
m_RootOrder: 1
|
||||
--- !u!4 &448922
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 130974}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -1, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 483646}
|
||||
m_RootOrder: 0
|
||||
--- !u!4 &483646
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 103546}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 448922}
|
||||
- {fileID: 431134}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
--- !u!114 &11403396
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 109056}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 11476518}
|
||||
handleType: 0
|
||||
leftHandleLocalPosition: {x: -.349999994, y: .349999994, z: 0}
|
||||
rightHandleLocalPosition: {x: .349999994, y: -.349999994, z: -0}
|
||||
--- !u!114 &11438208
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 130974}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 11476518}
|
||||
handleType: 0
|
||||
leftHandleLocalPosition: {x: -.349999994, y: -.349999994, z: 0}
|
||||
rightHandleLocalPosition: {x: .349999994, y: .349999994, z: -0}
|
||||
--- !u!114 &11476518
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 103546}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 066a41e004f415b4eb74d5e61a2aadbe, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curveColor: {r: 0, g: 1, b: 0, a: 1}
|
||||
startPointColor: {r: 1, g: 0, b: 0, a: 1}
|
||||
endPointColor: {r: 0, g: 0, b: 1, a: 1}
|
||||
segmentsCount: 15
|
||||
keyPoints:
|
||||
- {fileID: 11438208}
|
||||
- {fileID: 11403396}
|
||||
normalizedTime: .5
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 0}
|
||||
propertyPath: normalizedTime
|
||||
value: .649999976
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 103546}
|
||||
m_IsPrefabParent: 1
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6fd0b654e2119d64d86b0f77e5416930
|
||||
timeCreated: 1440612842
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
83
Assets/Plugins/NaughtyBezierCurves/README.md
Normal file
83
Assets/Plugins/NaughtyBezierCurves/README.md
Normal file
|
@ -0,0 +1,83 @@
|
|||
# NaughtyBezierCurves
|
||||
NaughtyBezierCurves is plugin for Unity which provides you with a BezierCurve GameObject.
|
||||
|
||||
<img src="https://github.com/dbrizov/dbrizov.github.io/blob/master/images/project-images/bezier-curve/bezier-curve.gif" alt="gif" width="350" /><br />
|
||||
<img src="https://github.com/dbrizov/dbrizov.github.io/blob/master/images/project-images/bezier-curve/bc4.png" alt="screenshot" width="350" />
|
||||
<img src="https://github.com/dbrizov/dbrizov.github.io/blob/master/images/project-images/bezier-curve/bc2.png" alt="screenshot" width="350" />
|
||||
|
||||
## System Requirements
|
||||
Unity 2017.3.0 or later versions.
|
||||
|
||||
## Installation
|
||||
Add this entry in your **manifest.json**
|
||||
```
|
||||
"com.dbrizov.naughtybeziercurves": "https://github.com/dbrizov/NaughtyBezierCurves.git#upm"
|
||||
```
|
||||
|
||||
## Features
|
||||
- Curve modification directly in the Scene View via Key Points with Handles
|
||||
- Custom editor for Adding, Deleting and Reordering Key Points very easily
|
||||
- Full Undo/Redo integration
|
||||
|
||||
## Ways to create a BezierCurve GameObject
|
||||
- From the Top Menu -> GameObjects -> Create Other -> Bezier Curve
|
||||
- Right click in the Hierarchy View -> Create Other -> Bezier Curve
|
||||
- Drag the prefab in the Scene (The prefab is located in "Assets/Bezier Curves/Prefabs" folder)
|
||||
|
||||
## Code Examples
|
||||
```C#
|
||||
BezierCurve3D curve = GetComponent<BezierCurve3D>();
|
||||
|
||||
// Evaluate a position and rotation along the curve at a given time
|
||||
float time = 0.5f; // In range [0, 1]
|
||||
Vector3 position = curve.GetPoint(time);
|
||||
Quaterion rotation = curve.GetRotation(time, Vector3.up);
|
||||
|
||||
// Get the length of the curve
|
||||
// This operation is not very heavy, but I advise you to cache the length if you are going to use it
|
||||
// many times and when you know that the curve won't change at runtime.
|
||||
float length = curve.GetApproximateLength();
|
||||
|
||||
// Other methods
|
||||
Vector3 tangent = curve.GetTangent(time);
|
||||
Vector3 binormal = curve.GetBinormal(time, Vector3.up);
|
||||
Vector3 normal = curve.GetNormal(time, Vector3.up);
|
||||
|
||||
// Add a key point at the end of the curve
|
||||
BezierPoint3D keyPoint = curve.AddKeyPoint(); // via fast method
|
||||
BezierPoint3D keyPoint = curve.AddKeyPointAt(curve.KeyPointsCount); // via specific index
|
||||
|
||||
// Remove a key point
|
||||
bool isRemoved = curve.RemoveKeyPointAt(0); // Remove the first key point
|
||||
|
||||
// Foreach all key points
|
||||
for (int i = 0; i < curve.KeyPointsCount; i++)
|
||||
{
|
||||
Debug.Log(curve.KeyPoints[i].Position);
|
||||
Debug.Log(curve.KeyPoints[i].LeftHandleLocalPosition);
|
||||
Debug.Log(curve.KeyPoints[i].RightHandleLocalPosition);
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Denis Rizov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
7
Assets/Plugins/NaughtyBezierCurves/README.md.meta
Normal file
7
Assets/Plugins/NaughtyBezierCurves/README.md.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 95f3ed4756bba9241b2529f705eb7c27
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Plugins/NaughtyBezierCurves/Scripts.meta
Normal file
9
Assets/Plugins/NaughtyBezierCurves/Scripts.meta
Normal file
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e4193362be79c574695b376148f680c9
|
||||
folderAsset: yes
|
||||
timeCreated: 1439998065
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Plugins/NaughtyBezierCurves/Scripts/Core.meta
Normal file
8
Assets/Plugins/NaughtyBezierCurves/Scripts/Core.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c19ce0ffba04ef7429fe5cd39b20e3d0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
393
Assets/Plugins/NaughtyBezierCurves/Scripts/Core/BezierCurve3D.cs
Normal file
393
Assets/Plugins/NaughtyBezierCurves/Scripts/Core/BezierCurve3D.cs
Normal file
|
@ -0,0 +1,393 @@
|
|||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NaughtyBezierCurves
|
||||
{
|
||||
public class BezierCurve3D : MonoBehaviour
|
||||
{
|
||||
// Serializable Fields
|
||||
[SerializeField]
|
||||
[Tooltip("The color used to render the curve")]
|
||||
private Color curveColor = Color.green;
|
||||
|
||||
[SerializeField]
|
||||
[Tooltip("The color used to render the start point of the curve")]
|
||||
private Color startPointColor = Color.red;
|
||||
|
||||
[SerializeField]
|
||||
[Tooltip("The color used to render the end point of the curve")]
|
||||
private Color endPointColor = Color.blue;
|
||||
|
||||
[SerializeField]
|
||||
[Tooltip("The number of segments that the curve has. Affects calculations and performance")]
|
||||
private int sampling = 25;
|
||||
|
||||
[SerializeField]
|
||||
[HideInInspector]
|
||||
private List<BezierPoint3D> keyPoints = new List<BezierPoint3D>();
|
||||
|
||||
[SerializeField]
|
||||
[Range(0f, 1f)]
|
||||
float normalizedTime = 0.5f;
|
||||
|
||||
// Properties
|
||||
public int Sampling
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.sampling;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.sampling = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<BezierPoint3D> KeyPoints
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.keyPoints;
|
||||
}
|
||||
}
|
||||
|
||||
public int KeyPointsCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.KeyPoints.Count;
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Adds a key point at the end of the curve
|
||||
/// </summary>
|
||||
/// <returns>The new key point</returns>
|
||||
public BezierPoint3D AddKeyPoint()
|
||||
{
|
||||
return this.AddKeyPointAt(this.KeyPointsCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a key point at a specified index
|
||||
/// </summary>
|
||||
/// <param name="index">The index at which the key point will be added</param>
|
||||
/// <returns>The new key point</returns>
|
||||
public BezierPoint3D AddKeyPointAt(int index)
|
||||
{
|
||||
BezierPoint3D newPoint = new GameObject("Point " + this.KeyPoints.Count, typeof(BezierPoint3D)).GetComponent<BezierPoint3D>();
|
||||
newPoint.Curve = this;
|
||||
newPoint.transform.parent = this.transform;
|
||||
newPoint.transform.localRotation = Quaternion.identity;
|
||||
|
||||
if (this.KeyPointsCount == 0 || this.KeyPointsCount == 1)
|
||||
{
|
||||
newPoint.LocalPosition = Vector3.zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
newPoint.Position = (this.KeyPoints[0].Position - this.KeyPoints[1].Position).normalized + this.KeyPoints[0].Position;
|
||||
}
|
||||
else if (index == this.KeyPointsCount)
|
||||
{
|
||||
newPoint.Position = (this.KeyPoints[index - 1].Position - this.KeyPoints[index - 2].Position).normalized + this.KeyPoints[index - 1].Position;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPoint.Position = BezierCurve3D.GetPointOnCubicCurve(0.5f, this.KeyPoints[index - 1], this.KeyPoints[index]);
|
||||
}
|
||||
}
|
||||
|
||||
this.KeyPoints.Insert(index, newPoint);
|
||||
|
||||
return newPoint;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes a key point at a specified index
|
||||
/// </summary>
|
||||
/// <param name="index">The index of the key point that will be removed</param>
|
||||
/// <returns>true - if the point was removed, false - otherwise</returns>
|
||||
public bool RemoveKeyPointAt(int index)
|
||||
{
|
||||
if (this.KeyPointsCount < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var point = this.KeyPoints[index];
|
||||
this.KeyPoints.RemoveAt(index);
|
||||
|
||||
Destroy(point.gameObject);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates a position along the curve at a specified normalized time [0, 1]
|
||||
/// </summary>
|
||||
/// <param name="time">The normalized length at which we want to get a position [0, 1]</param>
|
||||
/// <returns>The evaluated Vector3 position</returns>
|
||||
public Vector3 GetPoint(float time)
|
||||
{
|
||||
// The evaluated points is between these two points
|
||||
BezierPoint3D startPoint;
|
||||
BezierPoint3D endPoint;
|
||||
float timeRelativeToSegment;
|
||||
|
||||
this.GetCubicSegment(time, out startPoint, out endPoint, out timeRelativeToSegment);
|
||||
|
||||
return BezierCurve3D.GetPointOnCubicCurve(timeRelativeToSegment, startPoint, endPoint);
|
||||
}
|
||||
|
||||
public Quaternion GetRotation(float time, Vector3 up)
|
||||
{
|
||||
BezierPoint3D startPoint;
|
||||
BezierPoint3D endPoint;
|
||||
float timeRelativeToSegment;
|
||||
|
||||
this.GetCubicSegment(time, out startPoint, out endPoint, out timeRelativeToSegment);
|
||||
|
||||
return BezierCurve3D.GetRotationOnCubicCurve(timeRelativeToSegment, up, startPoint, endPoint);
|
||||
}
|
||||
|
||||
public Vector3 GetTangent(float time)
|
||||
{
|
||||
BezierPoint3D startPoint;
|
||||
BezierPoint3D endPoint;
|
||||
float timeRelativeToSegment;
|
||||
|
||||
this.GetCubicSegment(time, out startPoint, out endPoint, out timeRelativeToSegment);
|
||||
|
||||
return BezierCurve3D.GetTangentOnCubicCurve(timeRelativeToSegment, startPoint, endPoint);
|
||||
}
|
||||
|
||||
public Vector3 GetBinormal(float time, Vector3 up)
|
||||
{
|
||||
BezierPoint3D startPoint;
|
||||
BezierPoint3D endPoint;
|
||||
float timeRelativeToSegment;
|
||||
|
||||
this.GetCubicSegment(time, out startPoint, out endPoint, out timeRelativeToSegment);
|
||||
|
||||
return BezierCurve3D.GetBinormalOnCubicCurve(timeRelativeToSegment, up, startPoint, endPoint);
|
||||
}
|
||||
|
||||
public Vector3 GetNormal(float time, Vector3 up)
|
||||
{
|
||||
BezierPoint3D startPoint;
|
||||
BezierPoint3D endPoint;
|
||||
float timeRelativeToSegment;
|
||||
|
||||
this.GetCubicSegment(time, out startPoint, out endPoint, out timeRelativeToSegment);
|
||||
|
||||
return BezierCurve3D.GetNormalOnCubicCurve(timeRelativeToSegment, up, startPoint, endPoint);
|
||||
}
|
||||
|
||||
public float GetApproximateLength()
|
||||
{
|
||||
float length = 0;
|
||||
int subCurveSampling = (this.Sampling / (this.KeyPointsCount - 1)) + 1;
|
||||
for (int i = 0; i < this.KeyPointsCount - 1; i++)
|
||||
{
|
||||
length += BezierCurve3D.GetApproximateLengthOfCubicCurve(this.KeyPoints[i], this.KeyPoints[i + 1], subCurveSampling);
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
public void GetCubicSegment(float time, out BezierPoint3D startPoint, out BezierPoint3D endPoint, out float timeRelativeToSegment)
|
||||
{
|
||||
startPoint = null;
|
||||
endPoint = null;
|
||||
timeRelativeToSegment = 0f;
|
||||
|
||||
float subCurvePercent = 0f;
|
||||
float totalPercent = 0f;
|
||||
float approximateLength = this.GetApproximateLength();
|
||||
int subCurveSampling = (this.Sampling / (this.KeyPointsCount - 1)) + 1;
|
||||
|
||||
for (int i = 0; i < this.KeyPointsCount - 1; i++)
|
||||
{
|
||||
subCurvePercent = BezierCurve3D.GetApproximateLengthOfCubicCurve(this.KeyPoints[i], this.KeyPoints[i + 1], subCurveSampling) / approximateLength;
|
||||
if (subCurvePercent + totalPercent > time)
|
||||
{
|
||||
startPoint = this.KeyPoints[i];
|
||||
endPoint = this.KeyPoints[i + 1];
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
totalPercent += subCurvePercent;
|
||||
}
|
||||
|
||||
if (endPoint == null)
|
||||
{
|
||||
// If the evaluated point is very near to the end of the curve we are in the last segment
|
||||
startPoint = this.KeyPoints[this.KeyPointsCount - 2];
|
||||
endPoint = this.KeyPoints[this.KeyPointsCount - 1];
|
||||
|
||||
// We remove the percentage of the last sub-curve
|
||||
totalPercent -= subCurvePercent;
|
||||
}
|
||||
|
||||
timeRelativeToSegment = (time - totalPercent) / subCurvePercent;
|
||||
}
|
||||
|
||||
public static Vector3 GetPointOnCubicCurve(float time, BezierPoint3D startPoint, BezierPoint3D endPoint)
|
||||
{
|
||||
return GetPointOnCubicCurve(time, startPoint.Position, endPoint.Position, startPoint.RightHandlePosition, endPoint.LeftHandlePosition);
|
||||
}
|
||||
|
||||
public static Vector3 GetPointOnCubicCurve(float time, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent)
|
||||
{
|
||||
float t = time;
|
||||
float u = 1f - t;
|
||||
float t2 = t * t;
|
||||
float u2 = u * u;
|
||||
float u3 = u2 * u;
|
||||
float t3 = t2 * t;
|
||||
|
||||
Vector3 result =
|
||||
(u3) * startPosition +
|
||||
(3f * u2 * t) * startTangent +
|
||||
(3f * u * t2) * endTangent +
|
||||
(t3) * endPosition;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Quaternion GetRotationOnCubicCurve(float time, Vector3 up, BezierPoint3D startPoint, BezierPoint3D endPoint)
|
||||
{
|
||||
return GetRotationOnCubicCurve(time, up, startPoint.Position, endPoint.Position, startPoint.RightHandlePosition, endPoint.LeftHandlePosition);
|
||||
}
|
||||
|
||||
public static Quaternion GetRotationOnCubicCurve(float time, Vector3 up, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent)
|
||||
{
|
||||
Vector3 tangent = GetTangentOnCubicCurve(time, startPosition, endPosition, startTangent, endTangent);
|
||||
Vector3 normal = GetNormalOnCubicCurve(time, up, startPosition, endPosition, startTangent, endTangent);
|
||||
|
||||
return Quaternion.LookRotation(tangent, normal);
|
||||
}
|
||||
|
||||
public static Vector3 GetTangentOnCubicCurve(float time, BezierPoint3D startPoint, BezierPoint3D endPoint)
|
||||
{
|
||||
return GetTangentOnCubicCurve(time, startPoint.Position, endPoint.Position, startPoint.RightHandlePosition, endPoint.LeftHandlePosition);
|
||||
}
|
||||
|
||||
public static Vector3 GetTangentOnCubicCurve(float time, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent)
|
||||
{
|
||||
float t = time;
|
||||
float u = 1f - t;
|
||||
float u2 = u * u;
|
||||
float t2 = t * t;
|
||||
|
||||
Vector3 tangent =
|
||||
(-u2) * startPosition +
|
||||
(u * (u - 2f * t)) * startTangent -
|
||||
(t * (t - 2f * u)) * endTangent +
|
||||
(t2) * endPosition;
|
||||
|
||||
return tangent.normalized;
|
||||
}
|
||||
|
||||
public static Vector3 GetBinormalOnCubicCurve(float time, Vector3 up, BezierPoint3D startPoint, BezierPoint3D endPoint)
|
||||
{
|
||||
return GetBinormalOnCubicCurve(time, up, startPoint.Position, endPoint.Position, startPoint.RightHandlePosition, endPoint.LeftHandlePosition);
|
||||
}
|
||||
|
||||
public static Vector3 GetBinormalOnCubicCurve(float time, Vector3 up, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent)
|
||||
{
|
||||
Vector3 tangent = GetTangentOnCubicCurve(time, startPosition, endPosition, startTangent, endTangent);
|
||||
Vector3 binormal = Vector3.Cross(up, tangent);
|
||||
|
||||
return binormal.normalized;
|
||||
}
|
||||
|
||||
public static Vector3 GetNormalOnCubicCurve(float time, Vector3 up, BezierPoint3D startPoint, BezierPoint3D endPoint)
|
||||
{
|
||||
return GetNormalOnCubicCurve(time, up, startPoint.Position, endPoint.Position, startPoint.RightHandlePosition, endPoint.LeftHandlePosition);
|
||||
}
|
||||
|
||||
public static Vector3 GetNormalOnCubicCurve(float time, Vector3 up, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent)
|
||||
{
|
||||
Vector3 tangent = GetTangentOnCubicCurve(time, startPosition, endPosition, startTangent, endTangent);
|
||||
Vector3 binormal = GetBinormalOnCubicCurve(time, up, startPosition, endPosition, startTangent, endTangent);
|
||||
Vector3 normal = Vector3.Cross(tangent, binormal);
|
||||
|
||||
return normal.normalized;
|
||||
}
|
||||
|
||||
public static float GetApproximateLengthOfCubicCurve(BezierPoint3D startPoint, BezierPoint3D endPoint, int sampling)
|
||||
{
|
||||
return GetApproximateLengthOfCubicCurve(startPoint.Position, endPoint.Position, startPoint.RightHandlePosition, endPoint.LeftHandlePosition, sampling);
|
||||
}
|
||||
|
||||
public static float GetApproximateLengthOfCubicCurve(Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent, int sampling)
|
||||
{
|
||||
float length = 0f;
|
||||
Vector3 fromPoint = GetPointOnCubicCurve(0f, startPosition, endPosition, startTangent, endTangent);
|
||||
|
||||
for (int i = 0; i < sampling; i++)
|
||||
{
|
||||
float time = (i + 1) / (float)sampling;
|
||||
Vector3 toPoint = GetPointOnCubicCurve(time, startPosition, endPosition, startTangent, endTangent);
|
||||
length += Vector3.Distance(fromPoint, toPoint);
|
||||
fromPoint = toPoint;
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
// Protected Methods
|
||||
|
||||
protected virtual void OnDrawGizmos()
|
||||
{
|
||||
if (this.KeyPointsCount > 1)
|
||||
{
|
||||
// Draw the curve
|
||||
Vector3 fromPoint = this.GetPoint(0f);
|
||||
|
||||
for (int i = 0; i < this.Sampling; i++)
|
||||
{
|
||||
float time = (i + 1) / (float)this.Sampling;
|
||||
Vector3 toPoint = this.GetPoint(time);
|
||||
|
||||
// Draw segment
|
||||
Gizmos.color = this.curveColor;
|
||||
Gizmos.DrawLine(fromPoint, toPoint);
|
||||
|
||||
fromPoint = toPoint;
|
||||
}
|
||||
|
||||
// Draw the start and the end of the curve indicators
|
||||
Gizmos.color = this.startPointColor;
|
||||
Gizmos.DrawSphere(this.KeyPoints[0].Position, 0.05f);
|
||||
|
||||
Gizmos.color = this.endPointColor;
|
||||
Gizmos.DrawSphere(this.KeyPoints[this.KeyPointsCount - 1].Position, 0.05f);
|
||||
|
||||
// Draw the point at the normalized time
|
||||
Vector3 point = this.GetPoint(this.normalizedTime);
|
||||
Gizmos.color = Color.yellow;
|
||||
Gizmos.DrawSphere(point, 0.025f);
|
||||
|
||||
Vector3 tangent = this.GetTangent(this.normalizedTime);
|
||||
Gizmos.color = Color.blue;
|
||||
Gizmos.DrawLine(point, point + tangent / 2f);
|
||||
|
||||
Vector3 binormal = this.GetBinormal(this.normalizedTime, Vector3.up);
|
||||
Gizmos.color = Color.red;
|
||||
Gizmos.DrawLine(point, point + binormal / 2f);
|
||||
|
||||
Vector3 normal = this.GetNormal(this.normalizedTime, Vector3.up);
|
||||
Gizmos.color = Color.green;
|
||||
Gizmos.DrawLine(point, point + normal / 2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 066a41e004f415b4eb74d5e61a2aadbe
|
||||
timeCreated: 1440091708
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
161
Assets/Plugins/NaughtyBezierCurves/Scripts/Core/BezierPoint3D.cs
Normal file
161
Assets/Plugins/NaughtyBezierCurves/Scripts/Core/BezierPoint3D.cs
Normal file
|
@ -0,0 +1,161 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace NaughtyBezierCurves
|
||||
{
|
||||
public class BezierPoint3D : MonoBehaviour
|
||||
{
|
||||
public enum HandleType
|
||||
{
|
||||
Connected,
|
||||
Broken
|
||||
}
|
||||
|
||||
// Serializable Fields
|
||||
[SerializeField]
|
||||
[Tooltip("The curve that the point belongs to")]
|
||||
private BezierCurve3D curve = null;
|
||||
|
||||
[SerializeField]
|
||||
private HandleType handleType = HandleType.Connected;
|
||||
|
||||
[SerializeField]
|
||||
private Vector3 leftHandleLocalPosition = new Vector3(-0.5f, 0f, 0f);
|
||||
|
||||
[SerializeField]
|
||||
private Vector3 rightHandleLocalPosition = new Vector3(0.5f, 0f, 0f);
|
||||
|
||||
// Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the curve that the point belongs to.
|
||||
/// </summary>
|
||||
public BezierCurve3D Curve
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.curve;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.curve = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type/style of the handle.
|
||||
/// </summary>
|
||||
public HandleType HandleStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.handleType;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.handleType = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the transform.
|
||||
/// </summary>
|
||||
public Vector3 Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.transform.position;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.transform.position = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the transform.
|
||||
/// </summary>
|
||||
public Vector3 LocalPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.transform.localPosition;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.transform.localPosition = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the local position of the left handle.
|
||||
/// If the HandleStyle is Connected, the local position of the right handle is automaticaly set.
|
||||
/// </summary>
|
||||
public Vector3 LeftHandleLocalPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.leftHandleLocalPosition;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.leftHandleLocalPosition = value;
|
||||
if (this.handleType == HandleType.Connected)
|
||||
{
|
||||
this.rightHandleLocalPosition = -value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the local position of the right handle.
|
||||
/// If the HandleType is Connected, the local position of the left handle is automaticaly set.
|
||||
/// </summary>
|
||||
public Vector3 RightHandleLocalPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.rightHandleLocalPosition;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.rightHandleLocalPosition = value;
|
||||
if (this.handleType == HandleType.Connected)
|
||||
{
|
||||
this.leftHandleLocalPosition = -value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the left handle.
|
||||
/// If the HandleStyle is Connected, the position of the right handle is automaticaly set.
|
||||
/// </summary>
|
||||
public Vector3 LeftHandlePosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.transform.TransformPoint(this.LeftHandleLocalPosition);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.LeftHandleLocalPosition = this.transform.InverseTransformPoint(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the right handle.
|
||||
/// If the HandleType is Connected, the position of the left handle is automaticaly set.
|
||||
/// </summary>
|
||||
public Vector3 RightHandlePosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.transform.TransformPoint(this.RightHandleLocalPosition);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.RightHandleLocalPosition = this.transform.InverseTransformPoint(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b0cca3244f403c24f819a870f31cdc29
|
||||
timeCreated: 1440171924
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "NaughtyBezierCurves.Core",
|
||||
"references": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": []
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d2fe9127b8865fb4bb7faf7e51d4d250
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Plugins/NaughtyBezierCurves/Scripts/Editor.meta
Normal file
9
Assets/Plugins/NaughtyBezierCurves/Scripts/Editor.meta
Normal file
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b0767c05937ac1b428fba10f6f5b6b47
|
||||
folderAsset: yes
|
||||
timeCreated: 1440004821
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,219 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
|
||||
namespace NaughtyBezierCurves.Editor
|
||||
{
|
||||
[CustomEditor(typeof(BezierCurve3D))]
|
||||
[CanEditMultipleObjects]
|
||||
public class BezierCurve3DEditor : UnityEditor.Editor
|
||||
{
|
||||
private const float AddButtonWidth = 80f;
|
||||
private const float RemoveButtonWidth = 19f;
|
||||
|
||||
private BezierCurve3D curve;
|
||||
private ReorderableList keyPoints;
|
||||
private bool showPoints = true;
|
||||
|
||||
[MenuItem("GameObject/Create Other/Naughty Bezier Curve")]
|
||||
private static void CreateBezeirCurve()
|
||||
{
|
||||
BezierCurve3D curve = new GameObject("Bezier Curve", typeof(BezierCurve3D)).GetComponent<BezierCurve3D>();
|
||||
Vector3 position = Vector3.zero;
|
||||
if (Camera.current != null)
|
||||
{
|
||||
position = Camera.current.transform.position + Camera.current.transform.forward * 10f;
|
||||
}
|
||||
|
||||
curve.transform.position = position;
|
||||
|
||||
BezierCurve3DEditor.AddDefaultPoints(curve);
|
||||
|
||||
Undo.RegisterCreatedObjectUndo(curve.gameObject, "Create Curve");
|
||||
|
||||
Selection.activeGameObject = curve.gameObject;
|
||||
}
|
||||
|
||||
private static void AddDefaultPoints(BezierCurve3D curve)
|
||||
{
|
||||
BezierPoint3D startPoint = curve.AddKeyPoint();
|
||||
startPoint.LocalPosition = new Vector3(-1f, 0f, 0f);
|
||||
startPoint.LeftHandleLocalPosition = new Vector3(-0.35f, -0.35f, 0f);
|
||||
|
||||
BezierPoint3D endPoint = curve.AddKeyPoint();
|
||||
endPoint.LocalPosition = new Vector3(1f, 0f, 0f);
|
||||
endPoint.LeftHandleLocalPosition = new Vector3(-0.35f, 0.35f, 0f);
|
||||
}
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
this.curve = (BezierCurve3D)this.target;
|
||||
if (curve.KeyPointsCount < 2)
|
||||
{
|
||||
while (curve.KeyPointsCount != 0)
|
||||
{
|
||||
curve.RemoveKeyPointAt(this.curve.KeyPointsCount - 1);
|
||||
}
|
||||
|
||||
BezierCurve3DEditor.AddDefaultPoints(this.curve);
|
||||
}
|
||||
|
||||
this.keyPoints = new ReorderableList(this.serializedObject, serializedObject.FindProperty("keyPoints"), true, true, false, false);
|
||||
this.keyPoints.drawElementCallback = this.DrawElementCallback;
|
||||
this.keyPoints.drawHeaderCallback =
|
||||
(Rect rect) =>
|
||||
{
|
||||
EditorGUI.LabelField(rect, string.Format("Points: {0}", this.keyPoints.serializedProperty.arraySize), EditorStyles.boldLabel);
|
||||
};
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
this.serializedObject.Update();
|
||||
|
||||
if (GUILayout.Button("Log Length"))
|
||||
{
|
||||
Debug.Log(this.curve.GetApproximateLength());
|
||||
}
|
||||
|
||||
this.showPoints = EditorGUILayout.Foldout(this.showPoints, "Key Points");
|
||||
if (this.showPoints)
|
||||
{
|
||||
if (GUILayout.Button("Add Point"))
|
||||
{
|
||||
AddKeyPointAt(this.curve, this.curve.KeyPointsCount);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Add Point and Select"))
|
||||
{
|
||||
var point = AddKeyPointAt(this.curve, this.curve.KeyPointsCount);
|
||||
Selection.activeGameObject = point.gameObject;
|
||||
}
|
||||
|
||||
this.keyPoints.DoLayoutList();
|
||||
}
|
||||
|
||||
this.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
protected virtual void OnSceneGUI()
|
||||
{
|
||||
BezierCurve3DEditor.DrawPointsSceneGUI(this.curve);
|
||||
}
|
||||
|
||||
private void DrawElementCallback(Rect rect, int index, bool isActive, bool isFocused)
|
||||
{
|
||||
var element = this.keyPoints.serializedProperty.GetArrayElementAtIndex(index);
|
||||
rect.y += 2;
|
||||
|
||||
// Draw "Add Before" button
|
||||
if (GUI.Button(new Rect(rect.x, rect.y, AddButtonWidth, EditorGUIUtility.singleLineHeight), new GUIContent("Add Before")))
|
||||
{
|
||||
AddKeyPointAt(this.curve, index);
|
||||
}
|
||||
|
||||
// Draw point name
|
||||
EditorGUI.PropertyField(
|
||||
new Rect(rect.x + AddButtonWidth + 5f, rect.y, rect.width - AddButtonWidth * 2f - 35f, EditorGUIUtility.singleLineHeight), element, GUIContent.none);
|
||||
|
||||
// Draw "Add After" button
|
||||
if (GUI.Button(new Rect(rect.width - AddButtonWidth + 8f, rect.y, AddButtonWidth, EditorGUIUtility.singleLineHeight), new GUIContent("Add After")))
|
||||
{
|
||||
AddKeyPointAt(this.curve, index + 1);
|
||||
}
|
||||
|
||||
// Draw remove button
|
||||
if (this.curve.KeyPointsCount > 2)
|
||||
{
|
||||
if (GUI.Button(new Rect(rect.width + 14f, rect.y, RemoveButtonWidth, EditorGUIUtility.singleLineHeight), new GUIContent("x")))
|
||||
{
|
||||
RemoveKeyPointAt(this.curve, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawPointsSceneGUI(BezierCurve3D curve, BezierPoint3D exclude = null)
|
||||
{
|
||||
for (int i = 0; i < curve.KeyPointsCount; i++)
|
||||
{
|
||||
if (curve.KeyPoints[i] == exclude)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
BezierPoint3DEditor.handleCapSize = BezierPoint3DEditor.CircleCapSize;
|
||||
BezierPoint3DEditor.DrawPointSceneGUI(curve.KeyPoints[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private static void RenamePoints(BezierCurve3D curve)
|
||||
{
|
||||
for (int i = 0; i < curve.KeyPointsCount; i++)
|
||||
{
|
||||
curve.KeyPoints[i].name = "Point " + i;
|
||||
}
|
||||
}
|
||||
|
||||
private static BezierPoint3D AddKeyPointAt(BezierCurve3D curve, int index)
|
||||
{
|
||||
BezierPoint3D newPoint = new GameObject("Point " + curve.KeyPointsCount, typeof(BezierPoint3D)).GetComponent<BezierPoint3D>();
|
||||
newPoint.transform.parent = curve.transform;
|
||||
newPoint.transform.localRotation = Quaternion.identity;
|
||||
newPoint.Curve = curve;
|
||||
|
||||
if (curve.KeyPointsCount == 0 || curve.KeyPointsCount == 1)
|
||||
{
|
||||
newPoint.LocalPosition = Vector3.zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
newPoint.Position = (curve.KeyPoints[0].Position - curve.KeyPoints[1].Position).normalized + curve.KeyPoints[0].Position;
|
||||
}
|
||||
else if (index == curve.KeyPointsCount)
|
||||
{
|
||||
newPoint.Position = (curve.KeyPoints[index - 1].Position - curve.KeyPoints[index - 2].Position).normalized + curve.KeyPoints[index - 1].Position;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPoint.Position = BezierCurve3D.GetPointOnCubicCurve(0.5f, curve.KeyPoints[index - 1], curve.KeyPoints[index]);
|
||||
}
|
||||
}
|
||||
|
||||
Undo.IncrementCurrentGroup();
|
||||
Undo.RegisterCreatedObjectUndo(newPoint.gameObject, "Create Point");
|
||||
Undo.RegisterCompleteObjectUndo(curve, "Save Curve");
|
||||
|
||||
curve.KeyPoints.Insert(index, newPoint);
|
||||
RenamePoints(curve);
|
||||
|
||||
//Undo.RegisterCompleteObjectUndo(curve, "Save Curve");
|
||||
|
||||
return newPoint;
|
||||
}
|
||||
|
||||
private static bool RemoveKeyPointAt(BezierCurve3D curve, int index)
|
||||
{
|
||||
if (curve.KeyPointsCount < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var point = curve.KeyPoints[index];
|
||||
|
||||
Undo.IncrementCurrentGroup();
|
||||
Undo.RegisterCompleteObjectUndo(curve, "Save Curve");
|
||||
|
||||
curve.KeyPoints.RemoveAt(index);
|
||||
RenamePoints(curve);
|
||||
|
||||
//Undo.RegisterCompleteObjectUndo(curve, "Save Curve");
|
||||
Undo.DestroyObjectImmediate(point.gameObject);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bc31d5bbbea44db458c4a7ef9b0a0259
|
||||
timeCreated: 1440092287
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,119 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace NaughtyBezierCurves.Editor
|
||||
{
|
||||
[CustomEditor(typeof(BezierPoint3D), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class BezierPoint3DEditor : UnityEditor.Editor
|
||||
{
|
||||
public const float CircleCapSize = 0.075f;
|
||||
public const float RectangeCapSize = 0.1f;
|
||||
public const float SphereCapSize = 0.15f;
|
||||
|
||||
public static float pointCapSize = RectangeCapSize;
|
||||
public static float handleCapSize = CircleCapSize;
|
||||
|
||||
private BezierPoint3D point;
|
||||
private SerializedProperty handleType;
|
||||
private SerializedProperty leftHandleLocalPosition;
|
||||
private SerializedProperty rightHandleLocalPosition;
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
this.point = (BezierPoint3D)this.target;
|
||||
this.handleType = this.serializedObject.FindProperty("handleType");
|
||||
this.leftHandleLocalPosition = this.serializedObject.FindProperty("leftHandleLocalPosition");
|
||||
this.rightHandleLocalPosition = this.serializedObject.FindProperty("rightHandleLocalPosition");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
this.serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(this.handleType);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(this.leftHandleLocalPosition);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.rightHandleLocalPosition.vector3Value = -this.leftHandleLocalPosition.vector3Value;
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(this.rightHandleLocalPosition);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.leftHandleLocalPosition.vector3Value = -this.rightHandleLocalPosition.vector3Value;
|
||||
}
|
||||
|
||||
this.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
protected virtual void OnSceneGUI()
|
||||
{
|
||||
BezierPoint3DEditor.handleCapSize = BezierPoint3DEditor.CircleCapSize;
|
||||
BezierCurve3DEditor.DrawPointsSceneGUI(this.point.Curve, this.point);
|
||||
|
||||
BezierPoint3DEditor.handleCapSize = BezierPoint3DEditor.SphereCapSize;
|
||||
BezierPoint3DEditor.DrawPointSceneGUI(this.point, Handles.DotHandleCap, Handles.SphereHandleCap);
|
||||
}
|
||||
|
||||
public static void DrawPointSceneGUI(BezierPoint3D point)
|
||||
{
|
||||
DrawPointSceneGUI(point, Handles.RectangleHandleCap, Handles.CircleHandleCap);
|
||||
}
|
||||
|
||||
public static void DrawPointSceneGUI(BezierPoint3D point, Handles.CapFunction drawPointFunc, Handles.CapFunction drawHandleFunc)
|
||||
{
|
||||
// Draw a label for the point
|
||||
Handles.color = Color.black;
|
||||
Handles.Label(point.Position + new Vector3(0f, HandleUtility.GetHandleSize(point.Position) * 0.4f, 0f), point.gameObject.name);
|
||||
|
||||
// Draw the center of the control point
|
||||
Handles.color = Color.yellow;
|
||||
Vector3 newPointPosition = Handles.FreeMoveHandle(point.Position, point.transform.rotation,
|
||||
HandleUtility.GetHandleSize(point.Position) * BezierPoint3DEditor.pointCapSize, Vector3.one * 0.5f, drawPointFunc);
|
||||
|
||||
if (point.Position != newPointPosition)
|
||||
{
|
||||
Undo.RegisterCompleteObjectUndo(point.transform, "Move Point");
|
||||
point.Position = newPointPosition;
|
||||
}
|
||||
|
||||
// Draw the left and right handles
|
||||
Handles.color = Color.white;
|
||||
Handles.DrawLine(point.Position, point.LeftHandlePosition);
|
||||
Handles.DrawLine(point.Position, point.RightHandlePosition);
|
||||
|
||||
Handles.color = Color.cyan;
|
||||
Vector3 newLeftHandlePosition = Handles.FreeMoveHandle(point.LeftHandlePosition, point.transform.rotation,
|
||||
HandleUtility.GetHandleSize(point.LeftHandlePosition) * BezierPoint3DEditor.handleCapSize, Vector3.zero, drawHandleFunc);
|
||||
|
||||
if (point.LeftHandlePosition != newLeftHandlePosition)
|
||||
{
|
||||
Undo.RegisterCompleteObjectUndo(point, "Move Left Handle");
|
||||
point.LeftHandlePosition = newLeftHandlePosition;
|
||||
}
|
||||
|
||||
Vector3 newRightHandlePosition = Handles.FreeMoveHandle(point.RightHandlePosition, point.transform.rotation,
|
||||
HandleUtility.GetHandleSize(point.RightHandlePosition) * BezierPoint3DEditor.handleCapSize, Vector3.zero, drawHandleFunc);
|
||||
|
||||
if (point.RightHandlePosition != newRightHandlePosition)
|
||||
{
|
||||
Undo.RegisterCompleteObjectUndo(point, "Move Right Handle");
|
||||
point.RightHandlePosition = newRightHandlePosition;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool MouseButtonDown(int button)
|
||||
{
|
||||
return Event.current.type == EventType.MouseDown && Event.current.button == button;
|
||||
}
|
||||
|
||||
private static bool MouseButtonUp(int button)
|
||||
{
|
||||
return Event.current.type == EventType.MouseUp && Event.current.button == button;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ba98a4505903a6f40a28018c3224f5a6
|
||||
timeCreated: 1440173407
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "NaughtyBezierCurves.Editor",
|
||||
"references": [
|
||||
"NaughtyBezierCurves.Core"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": []
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a08874804a3abee48a23d50886fa4bfb
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
11
Assets/Plugins/NaughtyBezierCurves/package.json
Normal file
11
Assets/Plugins/NaughtyBezierCurves/package.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "com.dbrizov.naughtybeziercurves",
|
||||
"displayName": "NaughtyBezierCurves",
|
||||
"version": "1.0.0",
|
||||
"unity": "2017.3",
|
||||
"description": "NaughtyBezierCurves is an extension for Unity that provides a BezierCurve GameObject",
|
||||
"keywords": [ "bezier", "curve" ],
|
||||
"category": "editor extensions",
|
||||
"dependencies": {
|
||||
}
|
||||
}
|
7
Assets/Plugins/NaughtyBezierCurves/package.json.meta
Normal file
7
Assets/Plugins/NaughtyBezierCurves/package.json.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7142973882575364f88d8ca661dc4ef3
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -768,7 +768,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &2035530467837460450
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -896,7 +896,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &634606877704519381
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -6164,6 +6164,7 @@ MonoBehaviour:
|
|||
BulbHit: {fileID: 7248900333007582906}
|
||||
hitBarrel: 0
|
||||
currentComboPots: []
|
||||
comboNormalizedBeat: 0
|
||||
--- !u!95 &7248900332013002442
|
||||
Animator:
|
||||
serializedVersion: 3
|
||||
|
@ -6426,7 +6427,7 @@ SpriteRenderer:
|
|||
m_Size: {x: 12.8, y: 7.2}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_WasSpriteAssigned: 0
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &7248900332218536963
|
||||
|
@ -17782,7 +17783,7 @@ SpriteRenderer:
|
|||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: -300
|
||||
m_Sprite: {fileID: 21300000, guid: cbc090e55f5f26b49b81674708ad42a6, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: 1c02ce8c213d84d4c972dcdcbfbf535c, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
|
|
2245
Assets/Resources/Games/spaceSoccer.prefab
Normal file
2245
Assets/Resources/Games/spaceSoccer.prefab
Normal file
File diff suppressed because it is too large
Load diff
7
Assets/Resources/Games/spaceSoccer.prefab.meta
Normal file
7
Assets/Resources/Games/spaceSoccer.prefab.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 43bbc451d19fb534396f896077f3c1ab
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Resources/Music/SpaceSoccer.ogg
Normal file
BIN
Assets/Resources/Music/SpaceSoccer.ogg
Normal file
Binary file not shown.
22
Assets/Resources/Music/SpaceSoccer.ogg.meta
Normal file
22
Assets/Resources/Music/SpaceSoccer.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a0589cdba27fb254e90da17b4804c2fe
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Resources/Sfx/games/spaceSoccer.meta
Normal file
8
Assets/Resources/Sfx/games/spaceSoccer.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2dd63b42dd7dc294a9cbc5519eec5cb6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/ballHit.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/ballHit.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7be3b2013c2d0c34c931604607055453
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3c3bade935ab65a428422d9a5628ad83
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e5aa13cdf386f494fbdea7721aa87aba
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4f02b6a8e949a9d47a7f02ab93d8c2ba
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ec36e3347d5398d48abd8117795dccb6
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 25f76b9622876c1438b17dadc07bae75
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8f2c9b11810515640ac64e8c9ef73460
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bf50113ae1dbcc54490314e35f9ed5e8
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b4f240da2a6afc24cb5060f65fecf544
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0c33fb20a393d054c80913f6983e4a4a
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/highkicktoe1.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/highkicktoe1.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e591ab62352c1d24088004979fa6bcfb
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 64c331d8798918c4487e4849786dd1d7
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/highkicktoe2.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/highkicktoe2.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: df61415c8f3c19541919f5a68ada85d7
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/highkicktoe3.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/highkicktoe3.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7278ea9dfc90a40408d8d6730e4019d5
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4ec811e943a61954488e85c297664954
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/jetLong.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/jetLong.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5bb5d61162fc30d4e8bac1b3c9118bf8
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/jetShort.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/jetShort.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 81eb6d0eab105114eb9d1c8ff46bfc6c
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/jetSpeedUp.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/jetSpeedUp.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7678de6fa1729804caa2c9bb870a2bf8
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/jetStart.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/jetStart.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 19a4c6aac41082c46a5609e6c83db60b
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/spaceSoccer/kick.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/spaceSoccer/kick.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1a6438f4fcde68a42905281d1c55cdd0
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Resources/Sprites/Games/SpaceSoccer.meta
Normal file
8
Assets/Resources/Sprites/Games/SpaceSoccer.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 538c3b513b5b3ce43ad948f3994fae21
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ab56917cf9ff79a40a3ebb83fd65b528
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
613
Assets/Resources/Sprites/Games/SpaceSoccer/Animations/Idle.anim
Normal file
613
Assets/Resources/Sprites/Games/SpaceSoccer/Animations/Idle.anim
Normal file
|
@ -0,0 +1,613 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Idle
|
||||
serializedVersion: 6
|
||||
m_Legacy: 0
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves: []
|
||||
m_PositionCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: 0, y: 2.733, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path: Holder/Head
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: 0, y: 0.753, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path: Holder/Torso
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: -0.03500009, y: -0.847, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path: Holder/LowerTorso
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: -0.7379999, y: -2.485, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path: Holder/RightLeg
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: 0.04699993, y: -2.655, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path: Holder/LeftLeg
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: 0.2850001, y: 0.199, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path: Holder/LeftArm
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: {x: -0.848, y: 0.212, z: 0}
|
||||
inSlope: {x: 0, y: 0, z: 0}
|
||||
outSlope: {x: 0, y: 0, z: 0}
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
outWeight: {x: 0, y: 0.33333334, z: 0.33333334}
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
path: Holder/RightArm
|
||||
m_ScaleCurves: []
|
||||
m_FloatCurves: []
|
||||
m_PPtrCurves: []
|
||||
m_SampleRate: 60
|
||||
m_WrapMode: 0
|
||||
m_Bounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 0, y: 0, z: 0}
|
||||
m_ClipBindingConstant:
|
||||
genericBindings:
|
||||
- serializedVersion: 2
|
||||
path: 862337961
|
||||
attribute: 1
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 1903750507
|
||||
attribute: 1
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 2272283310
|
||||
attribute: 1
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 3667742504
|
||||
attribute: 1
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 354493626
|
||||
attribute: 1
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 4172274273
|
||||
attribute: 1
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 924037619
|
||||
attribute: 1
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 0
|
||||
isPPtrCurve: 0
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 0
|
||||
m_OrientationOffsetY: 0
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_HasAdditiveReferencePose: 0
|
||||
m_LoopTime: 1
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
m_LoopBlendPositionXZ: 0
|
||||
m_KeepOriginalOrientation: 0
|
||||
m_KeepOriginalPositionY: 1
|
||||
m_KeepOriginalPositionXZ: 0
|
||||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.x
|
||||
path: Holder/Head
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 2.733
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.y
|
||||
path: Holder/Head
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.z
|
||||
path: Holder/Head
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.x
|
||||
path: Holder/Torso
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0.753
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.y
|
||||
path: Holder/Torso
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.z
|
||||
path: Holder/Torso
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: -0.03500009
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.x
|
||||
path: Holder/LowerTorso
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: -0.847
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.y
|
||||
path: Holder/LowerTorso
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.z
|
||||
path: Holder/LowerTorso
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: -0.7379999
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.x
|
||||
path: Holder/RightLeg
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: -2.485
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.y
|
||||
path: Holder/RightLeg
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.z
|
||||
path: Holder/RightLeg
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0.04699993
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.x
|
||||
path: Holder/LeftLeg
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: -2.655
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.y
|
||||
path: Holder/LeftLeg
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.z
|
||||
path: Holder/LeftLeg
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0.2850001
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.x
|
||||
path: Holder/LeftArm
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0.199
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.y
|
||||
path: Holder/LeftArm
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.z
|
||||
path: Holder/LeftArm
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: -0.848
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.x
|
||||
path: Holder/RightArm
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0.212
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.y
|
||||
path: Holder/RightArm
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalPosition.z
|
||||
path: Holder/RightArm
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
m_EulerEditorCurves: []
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cce1bf1bd380a30468c8802519cab854
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
1363
Assets/Resources/Sprites/Games/SpaceSoccer/Animations/KickLeft.anim
Normal file
1363
Assets/Resources/Sprites/Games/SpaceSoccer/Animations/KickLeft.anim
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9d8b68c5ac526c84ca51cab516742ef2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
1345
Assets/Resources/Sprites/Games/SpaceSoccer/Animations/KickRight.anim
Normal file
1345
Assets/Resources/Sprites/Games/SpaceSoccer/Animations/KickRight.anim
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 86f86d1bf4236e248bf2dfa49c38483e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,176 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1101 &-8530771602459906365
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 933469538909251460}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 0
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1107 &-6751731036536900648
|
||||
AnimatorStateMachine:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Base Layer
|
||||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 933469538909251460}
|
||||
m_Position: {x: 200, y: 0, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -5556293797088629746}
|
||||
m_Position: {x: 370, y: -80, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -6379243465187239046}
|
||||
m_Position: {x: 130, y: -130, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
m_AnyStatePosition: {x: 50, y: 20, z: 0}
|
||||
m_EntryPosition: {x: 50, y: 120, z: 0}
|
||||
m_ExitPosition: {x: 800, y: 120, z: 0}
|
||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||
m_DefaultState: {fileID: 933469538909251460}
|
||||
--- !u!1102 &-6379243465187239046
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: KickRight
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: -3638761026158891027}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 86f86d1bf4236e248bf2dfa49c38483e, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1102 &-5556293797088629746
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: KickLeft
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: -8530771602459906365}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 9d8b68c5ac526c84ca51cab516742ef2, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &-3638761026158891027
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 933469538909251460}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 0
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Space Kicker
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
m_StateMachine: {fileID: -6751731036536900648}
|
||||
m_Mask: {fileID: 0}
|
||||
m_Motions: []
|
||||
m_Behaviours: []
|
||||
m_BlendingMode: 0
|
||||
m_SyncedLayerIndex: -1
|
||||
m_DefaultWeight: 0
|
||||
m_IKPass: 0
|
||||
m_SyncedLayerAffectsTiming: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
--- !u!1102 &933469538909251460
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Idle
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: cce1bf1bd380a30468c8802519cab854, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1727bb7e16d136b4d8d253268eb21960
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 9100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
1512
Assets/Resources/Sprites/Games/SpaceSoccer/spaceSoccer_main.png.meta
Normal file
1512
Assets/Resources/Sprites/Games/SpaceSoccer/spaceSoccer_main.png.meta
Normal file
File diff suppressed because it is too large
Load diff
144
Assets/Resources/Sprites/Games/SpaceSoccer/test_sheet.png.meta
Normal file
144
Assets/Resources/Sprites/Games/SpaceSoccer/test_sheet.png.meta
Normal file
|
@ -0,0 +1,144 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1de481a214d04684f97d357060f2503f
|
||||
TextureImporter:
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
213: -3453934474132030110
|
||||
second: test_sheet_0
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 72
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: test_sheet_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 345
|
||||
y: 3
|
||||
width: 256
|
||||
height: 257
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 26d72ef35e82110d0800000000000000
|
||||
internalID: -3453934474132030110
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -2185,7 +2185,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Color: {r: 0.15294118, g: 0.15294118, b: 0.15294118, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
|
@ -7940,8 +7940,8 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: f86858990a87c764892672104bdaef1f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
level: {fileID: 4900000, guid: cbe1a43c8ddc790498fde2e01e66d23e, type: 3}
|
||||
music: {fileID: 8300000, guid: 51af38323954a8d44874780ba4577fb4, type: 3}
|
||||
level: {fileID: 4900000, guid: 5e794baa94fb06d4f939aaf032fab5ea, type: 3}
|
||||
music: {fileID: 8300000, guid: f3b9f9179bad8394a98f617bda265a62, type: 3}
|
||||
debugUI: 0
|
||||
playOnStart: 0
|
||||
editor: 1
|
||||
|
|
|
@ -166,8 +166,8 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: f86858990a87c764892672104bdaef1f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
level: {fileID: 4900000, guid: 5e794baa94fb06d4f939aaf032fab5ea, type: 3}
|
||||
music: {fileID: 8300000, guid: f3b9f9179bad8394a98f617bda265a62, type: 3}
|
||||
level: {fileID: 4900000, guid: fafaeee85f4121643a0699a4de97da53, type: 3}
|
||||
music: {fileID: 8300000, guid: a0589cdba27fb254e90da17b4804c2fe, type: 3}
|
||||
debugUI: 1
|
||||
playOnStart: 1
|
||||
editor: 0
|
||||
|
|
|
@ -5,5 +5,6 @@ namespace RhythmHeavenMania
|
|||
public float length;
|
||||
public float startBeat;
|
||||
public float lastReportedBeat;
|
||||
public bool enabled;
|
||||
}
|
||||
}
|
|
@ -44,7 +44,7 @@ namespace RhythmHeavenMania
|
|||
|
||||
private void Awake()
|
||||
{
|
||||
autoplay = true;
|
||||
// autoplay = true;
|
||||
instance = this;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,11 +33,21 @@ namespace RhythmHeavenMania.Games
|
|||
{
|
||||
OnAce();
|
||||
AceVisuals();
|
||||
aceTimes++;
|
||||
// aceTimes++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetAce()
|
||||
{
|
||||
aceTimes = 0;
|
||||
}
|
||||
|
||||
public void ResetState()
|
||||
{
|
||||
lastState = 0;
|
||||
}
|
||||
|
||||
// could possibly add support for custom early, perfect, and end times if needed.
|
||||
public void StateCheck(float normalizedBeat)
|
||||
{
|
||||
|
|
8
Assets/Scripts/Games/SpaceSoccer.meta
Normal file
8
Assets/Scripts/Games/SpaceSoccer.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eeeba5ff8df3d434bb286b3e240afaab
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
175
Assets/Scripts/Games/SpaceSoccer/Ball.cs
Normal file
175
Assets/Scripts/Games/SpaceSoccer/Ball.cs
Normal file
|
@ -0,0 +1,175 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using NaughtyBezierCurves;
|
||||
using RhythmHeavenMania.Util;
|
||||
|
||||
namespace RhythmHeavenMania.Games.SpaceSoccer
|
||||
{
|
||||
public class Ball : PlayerActionObject
|
||||
{
|
||||
[Header("Components")]
|
||||
[SerializeField] private Kicker kicker;
|
||||
[SerializeField] private GameObject holder;
|
||||
[SerializeField] private GameObject spriteHolder;
|
||||
[Space(10)]
|
||||
[SerializeField] private BezierCurve3D dispenseCurve;
|
||||
[SerializeField] private BezierCurve3D kickCurve;
|
||||
[SerializeField] private BezierCurve3D highKickCurve;
|
||||
[SerializeField] private BezierCurve3D toeCurve;
|
||||
|
||||
[Header("Properties")]
|
||||
public float dispensedBeat = 0;
|
||||
public bool dispensing;
|
||||
public int hitTimes;
|
||||
private float lastSpriteRot;
|
||||
public bool canKick;
|
||||
private GameEvent kicked = new GameEvent();
|
||||
private GameEvent highKicked = new GameEvent();
|
||||
private GameEvent toe = new GameEvent();
|
||||
private bool kickPrepare = false;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
PlayerActionInit(this.gameObject, dispensedBeat);
|
||||
}
|
||||
|
||||
public override void OnAce()
|
||||
{
|
||||
kicker.Kick(this);
|
||||
}
|
||||
|
||||
public void Kick()
|
||||
{
|
||||
Jukebox.PlayOneShotGame("spaceSoccer/ballHit");
|
||||
kicker.Kick(this);
|
||||
|
||||
dispensing = false;
|
||||
kicked.enabled = true;
|
||||
kicked.startBeat = Conductor.instance.songPositionInBeats;
|
||||
// kicked.startBeat = dispensedBeat + 2 + hitTimes;
|
||||
|
||||
lastSpriteRot = spriteHolder.transform.eulerAngles.z;
|
||||
|
||||
hitTimes++;
|
||||
|
||||
if (hitTimes % 2 == 0)
|
||||
{
|
||||
kickCurve.transform.localScale = new Vector3(-1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
kickCurve.transform.localScale = new Vector3(1, 1);
|
||||
}
|
||||
kickCurve.KeyPoints[0].transform.position = holder.transform.position;
|
||||
|
||||
ResetState();
|
||||
}
|
||||
|
||||
public void HighKick()
|
||||
{
|
||||
Jukebox.PlayOneShotGame("spaceSoccer/highkicktoe1_hit");
|
||||
|
||||
kicked.enabled = false;
|
||||
highKicked.enabled = true;
|
||||
highKicked.startBeat = Conductor.instance.songPositionInBeats;
|
||||
|
||||
highKickCurve.KeyPoints[0].transform.position = holder.transform.position;
|
||||
}
|
||||
|
||||
public void Toe()
|
||||
{
|
||||
Jukebox.PlayOneShotGame("spaceSoccer/highkicktoe3_hit");
|
||||
|
||||
highKicked.enabled = false;
|
||||
kicked.enabled = false;
|
||||
kickPrepare = false;
|
||||
|
||||
toe.enabled = true;
|
||||
toe.startBeat = Conductor.instance.songPositionInBeats;
|
||||
|
||||
toeCurve.KeyPoints[0].transform.position = holder.transform.position;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
if (dispensing)
|
||||
{
|
||||
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(dispensedBeat, 2.5f);
|
||||
holder.transform.position = dispenseCurve.GetPoint(normalizedBeatAnim);
|
||||
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(0f, -1440f, normalizedBeatAnim));
|
||||
|
||||
float normalizedBeat = Conductor.instance.GetLoopPositionFromBeat(dispensedBeat, 2f);
|
||||
StateCheck(normalizedBeat);
|
||||
|
||||
if (PlayerInput.Pressed())
|
||||
{
|
||||
Kick();
|
||||
if (state.perfect)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (kicked.enabled)
|
||||
{
|
||||
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(kicked.startBeat, 1.5f);
|
||||
holder.transform.position = kickCurve.GetPoint(normalizedBeatAnim);
|
||||
if (hitTimes % 2 == 0)
|
||||
{
|
||||
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastSpriteRot, lastSpriteRot + 360f, normalizedBeatAnim));
|
||||
}
|
||||
else
|
||||
{
|
||||
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastSpriteRot, lastSpriteRot - 360f, normalizedBeatAnim));
|
||||
}
|
||||
|
||||
float normalizedBeat = Conductor.instance.GetLoopPositionFromBeat(kicked.startBeat, 1f);
|
||||
StateCheck(normalizedBeat);
|
||||
|
||||
if (PlayerInput.Pressed())
|
||||
{
|
||||
if (kicker.canHighKick)
|
||||
{
|
||||
HighKick();
|
||||
}
|
||||
else if (kicker.canKick)
|
||||
{
|
||||
Kick();
|
||||
}
|
||||
if (state.perfect)
|
||||
{
|
||||
// print(normalizedBeat);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (highKicked.enabled)
|
||||
{
|
||||
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(highKicked.startBeat, 1.85f);
|
||||
holder.transform.position = highKickCurve.GetPoint(normalizedBeatAnim);
|
||||
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastSpriteRot, -460f, normalizedBeatAnim));
|
||||
|
||||
if (PlayerInput.Pressed())
|
||||
{
|
||||
kickPrepare = true;
|
||||
kicker.Kick(this);
|
||||
}
|
||||
if (kickPrepare)
|
||||
{
|
||||
if (PlayerInput.PressedUp())
|
||||
{
|
||||
Toe();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (toe.enabled)
|
||||
{
|
||||
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(toe.startBeat, 1.85f);
|
||||
holder.transform.position = toeCurve.GetPoint(normalizedBeatAnim);
|
||||
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastSpriteRot, -860f, normalizedBeatAnim));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Games/SpaceSoccer/Ball.cs.meta
Normal file
11
Assets/Scripts/Games/SpaceSoccer/Ball.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6b323a3095c4c2e4db991ebafc1384cc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
62
Assets/Scripts/Games/SpaceSoccer/Kicker.cs
Normal file
62
Assets/Scripts/Games/SpaceSoccer/Kicker.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
|
||||
namespace RhythmHeavenMania.Games.SpaceSoccer
|
||||
{
|
||||
public class Kicker : MonoBehaviour
|
||||
{
|
||||
private GameEvent kickEvents = new GameEvent();
|
||||
|
||||
[Header("Properties")]
|
||||
public bool canKick;
|
||||
public bool canHighKick;
|
||||
|
||||
[Header("Components")]
|
||||
private Animator anim;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
anim = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
public void KeepUp(float beat, float length)
|
||||
{
|
||||
kickEvents.startBeat = beat;
|
||||
kickEvents.length = length;
|
||||
}
|
||||
|
||||
public void Kick(Ball b)
|
||||
{
|
||||
if (b.hitTimes % 2 == 0)
|
||||
{
|
||||
anim.Play("KickRight", 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
anim.Play("KickLeft", 0, 0);
|
||||
}
|
||||
Jukebox.PlayOneShotGame("spaceSoccer/kick");
|
||||
}
|
||||
|
||||
public void HighKick(float beat)
|
||||
{
|
||||
canHighKick = true;
|
||||
// Jukebox.PlayOneShotGame("spaceSoccer/highKickToe1");
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Conductor.instance.songPositionInBeats >= kickEvents.startBeat && Conductor.instance.songPositionInBeats < kickEvents.startBeat + kickEvents.length)
|
||||
{
|
||||
canKick = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
canKick = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Games/SpaceSoccer/Kicker.cs.meta
Normal file
11
Assets/Scripts/Games/SpaceSoccer/Kicker.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 848efddf5f5eaa94eacf8601e36f81bf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
66
Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs
Normal file
66
Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs
Normal file
|
@ -0,0 +1,66 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
|
||||
namespace RhythmHeavenMania.Games.SpaceSoccer
|
||||
{
|
||||
public class SpaceSoccer : Minigame
|
||||
{
|
||||
[Header("Components")]
|
||||
[SerializeField] private GameObject ballRef;
|
||||
[SerializeField] private Kicker kicker;
|
||||
|
||||
[Header("Properties")]
|
||||
[SerializeField] private bool ballDispensed;
|
||||
|
||||
public static SpaceSoccer instance { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (ballDispensed)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispense(float beat)
|
||||
{
|
||||
ballDispensed = true;
|
||||
|
||||
GameObject ball = Instantiate(ballRef, this.transform);
|
||||
Ball ball_ = ball.GetComponent<Ball>();
|
||||
ball_.dispensedBeat = beat;
|
||||
ball_.dispensing = true;
|
||||
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("spaceSoccer/dispenseNoise", beat),
|
||||
new MultiSound.Sound("spaceSoccer/dispenseTumble1", beat + 0.25f),
|
||||
new MultiSound.Sound("spaceSoccer/dispenseTumble2", beat + 0.5f),
|
||||
new MultiSound.Sound("spaceSoccer/dispenseTumble2B", beat + 0.5f),
|
||||
new MultiSound.Sound("spaceSoccer/dispenseTumble3", beat + 0.75f),
|
||||
new MultiSound.Sound("spaceSoccer/dispenseTumble4", beat + 1f),
|
||||
new MultiSound.Sound("spaceSoccer/dispenseTumble5", beat + 1.25f),
|
||||
new MultiSound.Sound("spaceSoccer/dispenseTumble6", beat + 1.5f),
|
||||
new MultiSound.Sound("spaceSoccer/dispenseTumble6B", beat + 1.75f),
|
||||
});
|
||||
}
|
||||
|
||||
public void KeepUp(float beat, float length)
|
||||
{
|
||||
kicker.KeepUp(beat, length);
|
||||
}
|
||||
|
||||
public void HighKick(float beat)
|
||||
{
|
||||
kicker.HighKick(beat);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
11
Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs.meta
Normal file
11
Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 924b8b91d38165d49bde41b195970f76
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -343,7 +343,7 @@ namespace RhythmHeavenMania.Editor
|
|||
else
|
||||
{
|
||||
eventObj.resizable = true;
|
||||
if (gameAction.defaultLength != entity.length && dragNDrop == false)
|
||||
if (entity != null && gameAction.defaultLength != entity.length && dragNDrop == false)
|
||||
{
|
||||
g.GetComponent<RectTransform>().sizeDelta = new Vector2(entity.length, LayerHeight());
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ using RhythmHeavenMania.Games.ForkLifter;
|
|||
using RhythmHeavenMania.Games.ClappyTrio;
|
||||
using RhythmHeavenMania.Games.Spaceball;
|
||||
using RhythmHeavenMania.Games.KarateMan;
|
||||
using RhythmHeavenMania.Games.SpaceSoccer;
|
||||
|
||||
namespace RhythmHeavenMania
|
||||
{
|
||||
|
@ -97,12 +98,12 @@ namespace RhythmHeavenMania
|
|||
new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ),
|
||||
new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }),
|
||||
}),
|
||||
/*new Minigame("spaceSoccer", "Space Soccer", "70A8D8", new List<GameAction>()
|
||||
new Minigame("spaceSoccer", "Space Soccer", "B888F8", new List<GameAction>()
|
||||
{
|
||||
new GameAction("ball dispense", delegate { }, 2f),
|
||||
new GameAction("keep-up", delegate { }, 4f, true),
|
||||
new GameAction("high kick-toe!", delegate { }, 3f),
|
||||
})*/
|
||||
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentBeat); }, 2f),
|
||||
new GameAction("keep-up", delegate { SpaceSoccer.instance.KeepUp(eventCaller.currentBeat, eventCaller.currentLength); }, 4f, true),
|
||||
new GameAction("high kick-toe!", delegate { SpaceSoccer.instance.HighKick(eventCaller.currentBeat); }, 3f),
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
1
Assets/spacesoccer.json
Normal file
1
Assets/spacesoccer.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"bpm":130.0,"entities":[{"beat":0.0,"track":0,"length":2.0,"datamodel":"spaceSoccer/ball dispense"},{"beat":2.0,"track":1,"length":2.0,"datamodel":"spaceSoccer/keep-up"},{"beat":4.0,"track":0,"length":3.0,"datamodel":"spaceSoccer/high kick-toe!"}]}
|
7
Assets/spacesoccer.json.meta
Normal file
7
Assets/spacesoccer.json.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fafaeee85f4121643a0699a4de97da53
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in a new issue