text
stringlengths 7
35.3M
| id
stringlengths 11
185
| metadata
dict | __index_level_0__
int64 0
2.14k
|
---|---|---|---|
fileFormatVersion: 2
guid: 4f8a06db5f80c254ca2b6fc63ea67657
labels:
- Documentation
- Example
- FSM
- FiniteStateMachine
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Examples/06 State Machines/06 Weapons/Documentation.URL.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/06 State Machines/06 Weapons/Documentation.URL.meta",
"repo_id": "jynew",
"token_count": 85
}
| 947 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Knight-Jump
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300060, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.06666667
value: {fileID: 21300062, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.13333334
value: {fileID: 21300064, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.2
value: {fileID: 21300066, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.26666668
value: {fileID: 21300068, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.33333334
value: {fileID: 21300070, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.4
value: {fileID: 21300072, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.46666667
value: {fileID: 21300074, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.53333336
value: {fileID: 21300076, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- time: 0.6
value: {fileID: 21300078, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 15
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: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 21300060, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300062, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300064, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300066, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300068, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300070, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300072, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300074, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300076, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
- {fileID: 21300078, guid: e95ee62c83fb0aa4cad4ffa4c5ae6f52, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.6666667
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
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: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
|
jynew/jyx2/Assets/3rd/Animancer/Examples/06 State Machines/07 Platformer/Knight/Knight-Jump.anim/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/06 State Machines/07 Platformer/Knight/Knight-Jump.anim",
"repo_id": "jynew",
"token_count": 1684
}
| 948 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!62 &6200000
PhysicsMaterial2D:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: NonFriction
friction: 0
bounciness: 0
|
jynew/jyx2/Assets/3rd/Animancer/Examples/06 State Machines/07 Platformer/NonFriction.physicsMaterial2D/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/06 State Machines/07 Platformer/NonFriction.physicsMaterial2D",
"repo_id": "jynew",
"token_count": 99
}
| 949 |
fileFormatVersion: 2
guid: 2ee86d3a5e2d3cf4fa965c906da1eb50
labels:
- Example
- Layers
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Examples/07 Layers/Upper Body.mask.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/07 Layers/Upper Body.mask.meta",
"repo_id": "jynew",
"token_count": 88
}
| 950 |
fileFormatVersion: 2
guid: ec8d802a502ae8b478740d949bedbbdf
labels:
- Example
- IK
- InverseKinematics
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Examples/08 Inverse Kinematics/01 Puppet/Puppet.unity.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/08 Inverse Kinematics/01 Puppet/Puppet.unity.meta",
"repo_id": "jynew",
"token_count": 80
}
| 951 |
[InternetShortcut]
URL=https://kybernetik.com.au/animancer/docs/examples/ik/
IDList=
HotKey=0
IconIndex=0
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
|
jynew/jyx2/Assets/3rd/Animancer/Examples/08 Inverse Kinematics/Documentation.URL/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/08 Inverse Kinematics/Documentation.URL",
"repo_id": "jynew",
"token_count": 71
}
| 952 |
fileFormatVersion: 2
guid: c3a57e5b17ad65742a7aa056677a8cf7
labels:
- Example
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Examples/09 Animator Controllers/02 Hybrid Mini Game.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/09 Animator Controllers/02 Hybrid Mini Game.meta",
"repo_id": "jynew",
"token_count": 78
}
| 953 |
fileFormatVersion: 2
guid: 741249036273ebb4083f510de01b5a6d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Examples/09 Animator Controllers/03 3D Game Kit/Creatures.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/09 Animator Controllers/03 3D Game Kit/Creatures.meta",
"repo_id": "jynew",
"token_count": 68
}
| 954 |
fileFormatVersion: 2
guid: 740026eefe7b72b409561e63cd33d592
labels:
- Example
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Examples/09 Animator Controllers/03 3D Game Kit/Fake Enemy.mat.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/09 Animator Controllers/03 3D Game Kit/Fake Enemy.mat.meta",
"repo_id": "jynew",
"token_count": 79
}
| 955 |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik //
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value.
using UnityEngine;
using UnityEngine.Events;
namespace Animancer.Examples.AnimatorControllers.GameKit
{
/// <summary>A <see cref="CreatureState"/> which plays a "landing on the ground" animation.</summary>
/// <example><see href="https://kybernetik.com.au/animancer/docs/examples/animator-controllers/3d-game-kit/landing">3D Game Kit/Landing</see></example>
/// https://kybernetik.com.au/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/LandingState
///
[AddComponentMenu(Strings.ExamplesMenuPrefix + "Game Kit - Landing State")]
[HelpURL(Strings.DocsURLs.ExampleAPIDocumentation + nameof(AnimatorControllers) + "." + nameof(GameKit) + "/" + nameof(LandingState))]
public sealed class LandingState : CreatureState
{
/************************************************************************************************************************/
[SerializeField] private MixerState.Transition2D _SoftLanding;
[SerializeField] private ClipState.Transition _HardLanding;
[SerializeField] private float _HardLandingForwardSpeed = 5;
[SerializeField] private float _HardLandingVerticalSpeed = -10;
[SerializeField] private UnityEvent _PlayAudio;// See the Read Me.
private bool _IsSoftLanding;
/************************************************************************************************************************/
private void Awake()
{
_SoftLanding.Events.OnEnd =
_HardLanding.Events.OnEnd =
() => Creature.CheckMotionState();
}
/************************************************************************************************************************/
public override bool CanEnterState => Creature.IsGrounded;
/************************************************************************************************************************/
/// <summary>
/// Performs either a hard or soft landing depending on the current speed (both horizontal and vertical).
/// </summary>
private void OnEnable()
{
Creature.ForwardSpeed = Creature.DesiredForwardSpeed;
if (Creature.VerticalSpeed <= _HardLandingVerticalSpeed &&
Creature.ForwardSpeed >= _HardLandingForwardSpeed)
{
_IsSoftLanding = false;
Creature.Animancer.Play(_HardLanding);
}
else
{
_IsSoftLanding = true;
Creature.Animancer.Play(_SoftLanding);
_SoftLanding.State.Parameter = new Vector2(Creature.ForwardSpeed, Creature.VerticalSpeed);
}
// The landing sounds in the full 3D Game Kit have different variations based on the ground material, just
// like the footstep sounds as discussed in the LocomotionState.
_PlayAudio.Invoke();
}
/************************************************************************************************************************/
public override bool FullMovementControl => _IsSoftLanding;
/************************************************************************************************************************/
private void FixedUpdate()
{
if (!Creature.IsGrounded &&
Creature.StateMachine.TrySetState(Creature.Airborne))
return;
Creature.UpdateSpeedControl();
if (_IsSoftLanding)
{
// Update the horizontal speed but keep the initial vertical speed from when you first landed.
var parameter = _SoftLanding.State.Parameter;
parameter.x = Creature.ForwardSpeed;
_SoftLanding.State.Parameter = parameter;
}
}
/************************************************************************************************************************/
}
}
|
jynew/jyx2/Assets/3rd/Animancer/Examples/09 Animator Controllers/03 3D Game Kit/States/LandingState.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/09 Animator Controllers/03 3D Game Kit/States/LandingState.cs",
"repo_id": "jynew",
"token_count": 1439
}
| 956 |
// Copyright Unity Technologies 2019 // https://github.com/Unity-Technologies/animation-jobs-samples //
// This file has not been modified other to put it in the Animancer.Examples.Jobs namespace and add this message and the comment on the struct.
using UnityEngine;
#if UNITY_2019_3_OR_NEWER
using UnityEngine.Animations;
#else
using UnityEngine.Experimental.Animations;
#endif
namespace Animancer.Examples.Jobs
{
/// <example><see href="https://kybernetik.com.au/animancer/docs/examples/jobs/two-bone-ik">Two Bone IK</see></example>
/// https://kybernetik.com.au/animancer/api/Animancer.Examples.Jobs/TwoBoneIKJob
///
public struct TwoBoneIKJob : IAnimationJob
{
public TransformSceneHandle effector;
public TransformStreamHandle top;
public TransformStreamHandle mid;
public TransformStreamHandle low;
public void Setup(Animator animator, Transform topX, Transform midX, Transform lowX, Transform effectorX)
{
top = animator.BindStreamTransform(topX);
mid = animator.BindStreamTransform(midX);
low = animator.BindStreamTransform(lowX);
effector = animator.BindSceneTransform(effectorX);
}
public void ProcessRootMotion(AnimationStream stream)
{
}
public void ProcessAnimation(AnimationStream stream)
{
Solve(stream, top, mid, low, effector);
}
/// <summary>
/// Returns the angle needed between v1 and v2 so that their extremities are
/// spaced with a specific length.
/// </summary>
/// <returns>The angle between v1 and v2.</returns>
/// <param name="aLen">The desired length between the extremities of v1 and v2.</param>
/// <param name="v1">First triangle edge.</param>
/// <param name="v2">Second triangle edge.</param>
private static float TriangleAngle(float aLen, Vector3 v1, Vector3 v2)
{
float aLen1 = v1.magnitude;
float aLen2 = v2.magnitude;
float c = Mathf.Clamp((aLen1 * aLen1 + aLen2 * aLen2 - aLen * aLen) / (aLen1 * aLen2) / 2.0f, -1.0f, 1.0f);
return Mathf.Acos(c);
}
private static void Solve(AnimationStream stream, TransformStreamHandle topHandle, TransformStreamHandle midHandle, TransformStreamHandle lowHandle, TransformSceneHandle effectorHandle)
{
Quaternion aRotation = topHandle.GetRotation(stream);
Quaternion bRotation = midHandle.GetRotation(stream);
Quaternion eRotation = effectorHandle.GetRotation(stream);
Vector3 aPosition = topHandle.GetPosition(stream);
Vector3 bPosition = midHandle.GetPosition(stream);
Vector3 cPosition = lowHandle.GetPosition(stream);
Vector3 ePosition = effectorHandle.GetPosition(stream);
Vector3 ab = bPosition - aPosition;
Vector3 bc = cPosition - bPosition;
Vector3 ac = cPosition - aPosition;
Vector3 ae = ePosition - aPosition;
float abcAngle = TriangleAngle(ac.magnitude, ab, bc);
float abeAngle = TriangleAngle(ae.magnitude, ab, bc);
float angle = (abcAngle - abeAngle) * Mathf.Rad2Deg;
Vector3 axis = Vector3.Cross(ab, bc).normalized;
Quaternion fromToRotation = Quaternion.AngleAxis(angle, axis);
Quaternion worldQ = fromToRotation * bRotation;
midHandle.SetRotation(stream, worldQ);
cPosition = lowHandle.GetPosition(stream);
ac = cPosition - aPosition;
Quaternion fromTo = Quaternion.FromToRotation(ac, ae);
topHandle.SetRotation(stream, fromTo * aRotation);
lowHandle.SetRotation(stream, eRotation);
}
}
}
|
jynew/jyx2/Assets/3rd/Animancer/Examples/10 Animation Jobs/01 Two Bone IK/TwoBoneIKJob.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/10 Animation Jobs/01 Two Bone IK/TwoBoneIKJob.cs",
"repo_id": "jynew",
"token_count": 1559
}
| 957 |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik //
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value.
using System;
using Unity.Collections;
using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Experimental.Animations;
namespace Animancer.Examples.Jobs
{
/// <summary>
/// A wrapper that manages an Animation Job (the <see cref="Job"/> struct nested inside this class) which rotates a
/// set of bones to allow the character to dynamically lean over independantly of their animations.
/// </summary>
///
/// <remarks>
/// The axis around which the bones are rotated can be set to achieve several different effects:
/// <list type="number">
/// <item>The right axis allows bending forwards and backwards.</item>
/// <item>The up axis allows turning to either side.</item>
/// <item>The forward axis allows leaning to either side.</item>
/// </list>
/// <see cref="https://github.com/KybernetikGames/animancer/issues/48#issuecomment-632336377">
/// This script is based on an implementation by ted-hou on GitHub.</see>
/// </remarks>
///
/// <example><see href="https://kybernetik.com.au/animancer/docs/examples/jobs/lean">Lean</see></example>
///
/// https://kybernetik.com.au/animancer/api/Animancer.Examples.Jobs/SimpleLean
///
public sealed class SimpleLean : AnimancerJob<SimpleLean.Job>, IDisposable
{
/************************************************************************************************************************/
#region Initialisation
/************************************************************************************************************************/
public SimpleLean(AnimancerPlayable animancer, Vector3 axis, NativeArray<TransformStreamHandle> leanBones)
{
var animator = animancer.Component.Animator;
_Job = new Job
{
root = animator.BindStreamTransform(animator.transform),
bones = leanBones,
axis = axis,
angle = AnimancerUtilities.CreateNativeReference<float>(),
};
CreatePlayable(animancer);
animancer.Disposables.Add(this);
}
/************************************************************************************************************************/
public SimpleLean(AnimancerPlayable animancer)
: this(animancer, Vector3.forward, GetDefaultHumanoidLeanBones(animancer.Component.Animator))
{ }
/************************************************************************************************************************/
public static NativeArray<TransformStreamHandle> GetDefaultHumanoidLeanBones(Animator animator)
{
var leanBones = new NativeArray<TransformStreamHandle>(2, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
leanBones[0] = animator.BindStreamTransform(animator.GetBoneTransform(HumanBodyBones.Spine));
leanBones[1] = animator.BindStreamTransform(animator.GetBoneTransform(HumanBodyBones.Chest));
return leanBones;
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Control
/************************************************************************************************************************/
// The Axis probably won't change often so the setter can just get the job data and change it.
/************************************************************************************************************************/
public Vector3 Axis
{
get => _Job.axis;
set
{
if (_Job.axis == value)
return;
_Job.axis = value;
_Playable.SetJobData(_Job);
}
}
/************************************************************************************************************************/
// But since the Angle could change all the time, we can exploit the fact that arrays are actualy references to avoid
// copying the entire struct out of the job playable then back in every time.
/************************************************************************************************************************/
public float Angle
{
get => _Job.angle[0];
set => _Job.angle[0] = value;
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Clean Up
/************************************************************************************************************************/
void IDisposable.Dispose() => Dispose();
/// <summary>Cleans up the <see cref="NativeArray{T}"/>s.</summary>
/// <remarks>Called by <see cref="AnimancerPlayable.OnPlayableDestroy"/>.</remarks>
private void Dispose()
{
if (_Job.angle.IsCreated)
_Job.angle.Dispose();
if (_Job.bones.IsCreated)
_Job.bones.Dispose();
}
/// <summary>Destroys the <see cref="_Playable"/> and restores the graph connection it was intercepting.</summary>
public override void Destroy()
{
Dispose();
base.Destroy();
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Job
/************************************************************************************************************************/
/// <summary>An <see cref="IAnimationJob"/> that applies a lean effect to an <see cref="AnimationStream"/>.</summary>
/// <example><see href="https://kybernetik.com.au/animancer/docs/examples/jobs/lean">Lean</see></example>
public struct Job : IAnimationJob
{
/************************************************************************************************************************/
public TransformStreamHandle root;
public NativeArray<TransformStreamHandle> bones;
public Vector3 axis;
public NativeArray<float> angle;
/************************************************************************************************************************/
public void ProcessRootMotion(AnimationStream stream) { }
/************************************************************************************************************************/
public void ProcessAnimation(AnimationStream stream)
{
var angle = this.angle[0] / bones.Length;
var worldAxis = root.GetRotation(stream) * axis;
var offset = Quaternion.AngleAxis(angle, worldAxis);
for (int i = bones.Length - 1; i >= 0; i--)
{
var bone = bones[i];
bone.SetRotation(stream, offset * bone.GetRotation(stream));
}
}
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
}
}
|
jynew/jyx2/Assets/3rd/Animancer/Examples/10 Animation Jobs/03 Lean/SimpleLean.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/10 Animation Jobs/03 Lean/SimpleLean.cs",
"repo_id": "jynew",
"token_count": 2573
}
| 958 |
fileFormatVersion: 2
guid: 6b6754727a425b241bd179af348a5153
labels:
- Example
- HugeFBXMocapLibrary
- Humanoid
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Examples/Art/Humanoid Animations/Humanoid-GolfSwing.anim.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/Art/Humanoid Animations/Humanoid-GolfSwing.anim.meta",
"repo_id": "jynew",
"token_count": 91
}
| 959 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1334077016099822
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4159243965375922}
m_Layer: 0
m_Name: GolfClub
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4159243965375922
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1334077016099822}
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: 4791611379812490}
- {fileID: 4864061806861914}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1376181651995660
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4864061806861914}
- component: {fileID: 33597807652823012}
- component: {fileID: 23106841281400502}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4864061806861914
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1376181651995660}
m_LocalRotation: {x: 0.130165, y: 0.71780914, z: 0.31861484, w: 0.6052205}
m_LocalPosition: {x: 0.010118127, y: -0.009009998, z: 1.0287877}
m_LocalScale: {x: 0.10000025, y: 0.15000011, z: 0.10000025}
m_Children: []
m_Father: {fileID: 4159243965375922}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: -17.449001, y: 3.8700001, z: 36.88}
--- !u!33 &33597807652823012
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1376181651995660}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &23106841281400502
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1376181651995660}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &1490394572306900
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4791611379812490}
- component: {fileID: 33068004716896568}
- component: {fileID: 23515098832691850}
m_Layer: 0
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4791611379812490
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1490394572306900}
m_LocalRotation: {x: 0.5, y: 0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0.47}
m_LocalScale: {x: 0.03, y: 0.53, z: 0.03}
m_Children: []
m_Father: {fileID: 4159243965375922}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
--- !u!33 &33068004716896568
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1490394572306900}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &23515098832691850
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1490394572306900}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
|
jynew/jyx2/Assets/3rd/Animancer/Examples/Art/Props/GolfClub.prefab/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/Art/Props/GolfClub.prefab",
"repo_id": "jynew",
"token_count": 2400
}
| 960 |
fileFormatVersion: 2
guid: 289a266921b90344fa42bebb00880d63
labels:
- Bot
- Example
- Generic
- MineBot
- Spider
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Examples/Art/Spider Bot/SpiderBot-MoveRight.anim.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Examples/Art/Spider Bot/SpiderBot-MoveRight.anim.meta",
"repo_id": "jynew",
"token_count": 93
}
| 961 |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik //
using System;
using UnityEngine;
namespace Animancer
{
/// <summary>[Pro-Only] A <see cref="ControllerState"/> which manages one float parameter.</summary>
/// <remarks>
/// Documentation: <see href="https://kybernetik.com.au/animancer/docs/manual/animator-controllers">Animator Controllers</see>
/// </remarks>
/// <seealso cref="Float2ControllerState"/>
/// <seealso cref="Float3ControllerState"/>
/// https://kybernetik.com.au/animancer/api/Animancer/Float1ControllerState
///
public sealed class Float1ControllerState : ControllerState
{
/************************************************************************************************************************/
private ParameterID _ParameterID;
/// <summary>The identifier of the parameter which <see cref="Parameter"/> will get and set.</summary>
public new ParameterID ParameterID
{
get => _ParameterID;
set
{
_ParameterID = value;
_ParameterID.ValidateHasParameter(Controller, AnimatorControllerParameterType.Float);
}
}
/// <summary>
/// Gets and sets a float parameter in the <see cref="ControllerState.Controller"/> using the
/// <see cref="ParameterID"/>.
/// </summary>
public float Parameter
{
get => Playable.GetFloat(_ParameterID.Hash);
set => Playable.SetFloat(_ParameterID.Hash, value);
}
/************************************************************************************************************************/
/// <summary>Creates a new <see cref="Float1ControllerState"/> to play the `controller`.</summary>
public Float1ControllerState(RuntimeAnimatorController controller, ParameterID parameter,
bool keepStateOnStop = false)
: base(controller, keepStateOnStop)
{
_ParameterID = parameter;
_ParameterID.ValidateHasParameter(controller, AnimatorControllerParameterType.Float);
}
/************************************************************************************************************************/
/// <inheritdoc/>
public override int ParameterCount => 1;
/// <inheritdoc/>
public override int GetParameterHash(int index) => _ParameterID;
/************************************************************************************************************************/
#region Transition
/************************************************************************************************************************/
/// <summary>
/// A serializable <see cref="ITransition"/> which can create a <see cref="Float1ControllerState"/>
/// when passed into <see cref="AnimancerPlayable.Play(ITransition)"/>.
/// </summary>
/// <remarks>
/// Unfortunately the tool used to generate this documentation does not currently support nested types with
/// identical names, so only one <c>Transition</c> class will actually have a documentation page.
/// <para></para>
/// Documentation: <see href="https://kybernetik.com.au/animancer/docs/manual/transitions">Transitions</see>
/// </remarks>
/// https://kybernetik.com.au/animancer/api/Animancer/Transition
///
[Serializable]
public new class Transition : Transition<Float1ControllerState>
{
/************************************************************************************************************************/
[SerializeField]
private string _ParameterName;
/// <summary>[<see cref="SerializeField"/>] The name that will be used to access <see cref="Parameter"/>.</summary>
public ref string ParameterName => ref _ParameterName;
/************************************************************************************************************************/
/// <summary>Creates a new <see cref="Transition"/>.</summary>
public Transition() { }
/// <summary>Creates a new <see cref="Transition"/> with the specified Animator Controller and parameter.</summary>
public Transition(RuntimeAnimatorController controller, string parameterName)
{
Controller = controller;
_ParameterName = parameterName;
}
/************************************************************************************************************************/
/// <summary>Creates and returns a new <see cref="Float1ControllerState"/>.</summary>
/// <remarks>
/// Note that using methods like <see cref="AnimancerPlayable.Play(ITransition)"/> will also call
/// <see cref="ITransition.Apply"/>, so if you call this method manually you may want to call that method
/// as well. Or you can just use <see cref="AnimancerUtilities.CreateStateAndApply"/>.
/// <para></para>
/// This method also assigns it as the <see cref="AnimancerState.Transition{TState}.State"/>.
/// </remarks>
public override Float1ControllerState CreateState()
=> State = new Float1ControllerState(Controller, _ParameterName, KeepStateOnStop);
/************************************************************************************************************************/
#region Drawer
#if UNITY_EDITOR
/************************************************************************************************************************/
/// <summary>[Editor-Only] Draws the Inspector GUI for a <see cref="Transition"/>.</summary>
/// <remarks>
/// Unfortunately the tool used to generate this documentation does not currently support nested types with
/// identical names, so only one <c>Drawer</c> class will actually have a documentation page.
/// <para></para>
/// Documentation: <see href="https://kybernetik.com.au/animancer/docs/manual/transitions">Transitions</see>
/// </remarks>
[UnityEditor.CustomPropertyDrawer(typeof(Transition), true)]
public class Drawer : ControllerState.Transition.Drawer
{
/************************************************************************************************************************/
/// <summary>
/// Creates a new <see cref="Drawer"/> and sets the
/// <see cref="ControllerState.Transition.Drawer.Parameters"/>.
/// </summary>
public Drawer() : base(nameof(_ParameterName)) { }
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endif
#endregion
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
}
}
|
jynew/jyx2/Assets/3rd/Animancer/Internal/Controller States/Float1ControllerState.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Internal/Controller States/Float1ControllerState.cs",
"repo_id": "jynew",
"token_count": 2482
}
| 962 |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik //
#if UNITY_EDITOR
using System;
namespace Animancer.Editor
{
/// <summary>[Editor-Only]
/// Causes an Inspector field in an <see cref="ITransition"/> to be drawn after its events where the events would
/// normally be drawn last.
/// </summary>
/// https://kybernetik.com.au/animancer/api/Animancer.Editor/DrawAfterEventsAttribute
///
[AttributeUsage(AttributeTargets.Field)]
public sealed class DrawAfterEventsAttribute : Attribute { }
}
#endif
|
jynew/jyx2/Assets/3rd/Animancer/Internal/Editor/Inspector/DrawAfterEventsAttribute.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Internal/Editor/Inspector/DrawAfterEventsAttribute.cs",
"repo_id": "jynew",
"token_count": 184
}
| 963 |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik //
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Animancer.Editor
{
/// <summary>[Editor-Only]
/// A custom Inspector for <see cref="Sprite"/>s allows you to directly edit them instead of just showing their
/// details like the default one does.
/// </summary>
/// https://kybernetik.com.au/animancer/api/Animancer.Editor/SpriteEditor
///
[CustomEditor(typeof(Sprite), true), CanEditMultipleObjects]
public class SpriteEditor : UnityEditor.Editor
{
/************************************************************************************************************************/
private const string
NameTooltip = "The asset name of the sprite",
RectTooltip = "The texture area occupied by the sprite",
PivotTooltip = "The origin point of the sprite relative to its Rect",
BorderTooltip = "The edge sizes used when 9-Slicing the sprite for the UI system (ignored by SpriteRenderers)";
[NonSerialized]
private SerializedProperty
_Name,
_Rect,
_Pivot,
_Border;
[NonSerialized]
private TwinFloatField[]
_RectFields,
_PivotFields,
_BorderFields;
[NonSerialized]
private bool _HasBeenModified;
/************************************************************************************************************************/
private void OnEnable()
{
InitialisePreview();
_Name = serializedObject.FindProperty($"m{nameof(_Name)}");
_Rect = serializedObject.FindProperty($"m{nameof(_Rect)}");
if (_Rect != null)
{
_RectFields = new TwinFloatField[]
{
new TwinFloatField(_Rect.FindPropertyRelative(nameof(Rect.x)), new GUIContent("X (Left)",
"The distance from the left edge of the texture to the left edge of the sprite"), false),
new TwinFloatField(_Rect.FindPropertyRelative(nameof(Rect.y)), new GUIContent("Y (Bottom)",
"The distance from the bottom edge of the texture to the bottom edge of the sprite"), false),
new TwinFloatField(_Rect.FindPropertyRelative(nameof(Rect.width)), new GUIContent("Width",
"The horizontal size of the sprite"), false),
new TwinFloatField(_Rect.FindPropertyRelative(nameof(Rect.height)), new GUIContent("Height",
"The vertical size of the sprite"), false),
};
}
_Pivot = serializedObject.FindProperty($"m{nameof(_Pivot)}");
if (_Pivot != null)
{
_PivotFields = new TwinFloatField[]
{
new TwinFloatField(_Pivot.FindPropertyRelative(nameof(Vector2.x)), new GUIContent("X",
"The horizontal distance from the left edge of the sprite to the pivot point"), true),
new TwinFloatField(_Pivot.FindPropertyRelative(nameof(Vector2.y)), new GUIContent("Y",
"The vertical distance from the bottom edge of the sprite to the pivot point"), true),
};
}
_Border = serializedObject.FindProperty($"m{nameof(_Border)}");
if (_Border != null)
{
_BorderFields = new TwinFloatField[]
{
new TwinFloatField(_Border.FindPropertyRelative(nameof(Vector4.x)), new GUIContent("Left",
BorderTooltip), false),
new TwinFloatField(_Border.FindPropertyRelative(nameof(Vector4.y)), new GUIContent("Bottom",
BorderTooltip), false),
new TwinFloatField(_Border.FindPropertyRelative(nameof(Vector4.z)), new GUIContent("Right",
BorderTooltip), false),
new TwinFloatField(_Border.FindPropertyRelative(nameof(Vector4.w)), new GUIContent("Top",
BorderTooltip), false),
};
}
}
/************************************************************************************************************************/
private void OnDisable()
{
CleanUpPreview();
if (_HasBeenModified)
{
var sprite = target as Sprite;
if (sprite == null)
return;
if (EditorUtility.DisplayDialog("Unapplied Import Settings",
$"Unapplied import settings for '{sprite.name}' in '{AssetDatabase.GetAssetPath(sprite)}'",
nameof(Apply), nameof(Revert)))
Apply();
}
}
/************************************************************************************************************************/
#region Inspector
/************************************************************************************************************************/
/// <summary>Called by the Unity editor to draw the custom Inspector GUI elements.</summary>
public override void OnInspectorGUI()
{
EditorGUI.BeginChangeCheck();
DoNameGUI();
DoRectGUI();
DoPivotGUI();
DoBorderGUI();
if (EditorGUI.EndChangeCheck())
_HasBeenModified = true;
GUILayout.Space(AnimancerGUI.StandardSpacing);
GUILayout.BeginHorizontal();
{
GUILayout.FlexibleSpace();
GUI.enabled = _HasBeenModified;
if (GUILayout.Button(nameof(Revert)))
Revert();
if (GUILayout.Button(nameof(Apply)))
Apply();
}
GUILayout.EndHorizontal();
}
/************************************************************************************************************************/
private void DoNameGUI()
{
GUILayout.BeginHorizontal();
var enabled = GUI.enabled;
if (_Name.hasMultipleDifferentValues)
GUI.enabled = false;
EditorGUILayout.PropertyField(_Name, AnimancerGUI.TempContent("Name", NameTooltip), true);
GUI.enabled = true;
var changed = EditorGUI.EndChangeCheck();// Exclude the Rename button from the main change check.
if (GUILayout.Button("Rename Tool", EditorStyles.miniButton, AnimancerGUI.DontExpandWidth))
AnimancerToolsWindow.Open(typeof(AnimancerToolsWindow.RenameSprites));
EditorGUI.BeginChangeCheck();
if (changed)
GUI.changed = true;
GUI.enabled = enabled;
GUILayout.EndHorizontal();
}
/************************************************************************************************************************/
private static ConversionCache<float, string> _NormalizedSuffixCache, _PixelSuffixCache;
private static float DoTwinFloatFieldGUI(Rect area, GUIContent label, float value, float normalizeMultiplier, bool isNormalized)
{
if (_PixelSuffixCache == null)
{
_PixelSuffixCache = new ConversionCache<float, string>((s) => s + "px");
_NormalizedSuffixCache = new ConversionCache<float, string>((x) => x + "x");
}
var split = (area.width - EditorGUIUtility.labelWidth - AnimancerGUI.StandardSpacing) * 0.5f;
var normalizedArea = AnimancerGUI.StealFromRight(ref area, Mathf.Floor(split), AnimancerGUI.StandardSpacing);
var pixels = isNormalized ? value / normalizeMultiplier : value;
var normalized = isNormalized ? value : value * normalizeMultiplier;
EditorGUI.BeginChangeCheck();
pixels = AnimancerGUI.DoSpecialFloatField(area, label, pixels, _PixelSuffixCache);
if (EditorGUI.EndChangeCheck())
value = isNormalized ? pixels * normalizeMultiplier : pixels;
EditorGUI.BeginChangeCheck();
normalized = AnimancerGUI.DoSpecialFloatField(normalizedArea, null, normalized, _NormalizedSuffixCache);
if (EditorGUI.EndChangeCheck())
value = isNormalized ? normalized : normalized / normalizeMultiplier;
return value;
}
/************************************************************************************************************************/
private void DoRectGUI()
{
var texture = ((Sprite)target).texture;
_RectFields[0].normalizeMultiplier = _RectFields[2].normalizeMultiplier = 1f / texture.width;
_RectFields[1].normalizeMultiplier = _RectFields[3].normalizeMultiplier = 1f / texture.height;
TwinFloatField.DoGroupGUI(_Rect, AnimancerGUI.TempContent("Rect", RectTooltip), _RectFields);
}
/************************************************************************************************************************/
private void DoPivotGUI()
{
var showMixedValue = EditorGUI.showMixedValue;
var targets = this.targets;
var size = targets[0] is Sprite sprite ? sprite.rect.size : Vector2.one;
for (int i = 1; i < targets.Length; i++)
{
sprite = targets[i] as Sprite;
if (sprite == null || sprite.rect.size != size)
EditorGUI.showMixedValue = true;
}
_PivotFields[0].normalizeMultiplier = 1f / size.x;
_PivotFields[1].normalizeMultiplier = 1f / size.y;
TwinFloatField.DoGroupGUI(_Pivot, AnimancerGUI.TempContent("Pivot", PivotTooltip), _PivotFields);
EditorGUI.showMixedValue = showMixedValue;
}
/************************************************************************************************************************/
private void DoBorderGUI()
{
var size = _Rect.rectValue.size;
_BorderFields[0].normalizeMultiplier = _BorderFields[2].normalizeMultiplier = 1f / size.x;
_BorderFields[1].normalizeMultiplier = _BorderFields[3].normalizeMultiplier = 1f / size.y;
TwinFloatField.DoGroupGUI(_Border, AnimancerGUI.TempContent("Border", BorderTooltip), _BorderFields);
}
/************************************************************************************************************************/
private void Revert()
{
AnimancerGUI.Deselect();
_HasBeenModified = false;
serializedObject.Update();
}
/************************************************************************************************************************/
private void Apply()
{
AnimancerGUI.Deselect();
_HasBeenModified = false;
var targets = this.targets;
var path = AssetDatabase.GetAssetPath(targets[0]);
var importer = (TextureImporter)AssetImporter.GetAtPath(path);
var spriteSheet = importer.spritesheet;
var hasError = false;
for (int i = 0; i < targets.Length; i++)
Apply((Sprite)targets[i], spriteSheet, ref hasError);
serializedObject.Update();
if (!hasError)
{
importer.spritesheet = spriteSheet;
EditorUtility.SetDirty(importer);
importer.SaveAndReimport();
}
}
/************************************************************************************************************************/
private void Apply(Sprite sprite, SpriteMetaData[] spriteSheet, ref bool hasError)
{
for (int i = 0; i < spriteSheet.Length; i++)
{
ref var spriteData = ref spriteSheet[i];
if (spriteData.name == sprite.name &&
spriteData.rect == sprite.rect)
{
if (!_Name.hasMultipleDifferentValues)
spriteData.name = _Name.stringValue;
if (!_Rect.hasMultipleDifferentValues)
spriteData.rect = _Rect.rectValue;
if (!_Pivot.hasMultipleDifferentValues)
spriteData.pivot = _Pivot.vector2Value;
if (!_Border.hasMultipleDifferentValues)
spriteData.border = _Border.vector4Value;
if (spriteData.rect.xMin < 0 ||
spriteData.rect.yMin < 0 ||
spriteData.rect.xMax > sprite.texture.width ||
spriteData.rect.yMax > sprite.texture.height)
{
hasError = true;
Debug.LogError($"This modification would have put '{sprite.name}' out of bounds" +
$" so these modifications were not applied.");
}
return;
}
}
Debug.LogError($"Unable to find data for {sprite.name}", sprite);
}
/************************************************************************************************************************/
#region Twin Float Field
/************************************************************************************************************************/
/// <summary>
/// A wrapper around a <see cref="SerializedProperty"/> to display it using two float fields where one is
/// normalized and the other is not.
/// </summary>
public sealed class TwinFloatField
{
/************************************************************************************************************************/
/// <summary>The target property.</summary>
public readonly SerializedProperty Property;
/// <summary>The label to display next to the property.</summary>
public readonly GUIContent Label;
/// <summary>Is the serialized property value normalized?</summary>
public readonly bool IsNormalized;
/// <summary>The multiplier to turn a non-normalized value into a normalized one.</summary>
public float normalizeMultiplier;
/************************************************************************************************************************/
/// <summary>Creates a new <see cref="TwinFloatField"/>.</summary>
public TwinFloatField(SerializedProperty property, GUIContent label, bool isNormalized)
{
Property = property;
Label = label;
IsNormalized = isNormalized;
}
/************************************************************************************************************************/
/// <summary>Draws a group of <see cref="TwinFloatField"/>s.</summary>
public static void DoGroupGUI(SerializedProperty baseProperty, GUIContent label, TwinFloatField[] fields)
{
var height = (AnimancerGUI.LineHeight + AnimancerGUI.StandardSpacing) * (fields.Length + 1);
var area = GUILayoutUtility.GetRect(0, height);
area.height = AnimancerGUI.LineHeight;
label = EditorGUI.BeginProperty(area, label, baseProperty);
GUI.Label(area, label);
EditorGUI.EndProperty();
EditorGUI.indentLevel++;
for (int i = 0; i < fields.Length; i++)
{
AnimancerGUI.NextVerticalArea(ref area);
fields[i].DoTwinFloatFieldGUI(area);
}
EditorGUI.indentLevel--;
}
/************************************************************************************************************************/
/// <summary>Draws this <see cref="TwinFloatField"/>.</summary>
public void DoTwinFloatFieldGUI(Rect area)
{
var label = EditorGUI.BeginProperty(area, Label, Property);
EditorGUI.BeginChangeCheck();
var value = Property.floatValue;
value = DoTwinFloatFieldGUI(area, label, value, normalizeMultiplier, IsNormalized);
if (EditorGUI.EndChangeCheck())
Property.floatValue = value;
EditorGUI.EndProperty();
}
/************************************************************************************************************************/
private static ConversionCache<float, string> _NormalizedSuffixCache, _PixelSuffixCache;
/// <summary>Draws two float fields.</summary>
public static float DoTwinFloatFieldGUI(Rect area, GUIContent label, float value, float normalizeMultiplier, bool isNormalized)
{
if (_PixelSuffixCache == null)
{
_PixelSuffixCache = new ConversionCache<float, string>((s) => s + "px");
_NormalizedSuffixCache = new ConversionCache<float, string>((x) => x + "x");
}
var split = (area.width - EditorGUIUtility.labelWidth - AnimancerGUI.StandardSpacing) * 0.5f;
var normalizedArea = AnimancerGUI.StealFromRight(ref area, Mathf.Floor(split), AnimancerGUI.StandardSpacing);
var pixels = isNormalized ? value / normalizeMultiplier : value;
var normalized = isNormalized ? value : value * normalizeMultiplier;
EditorGUI.BeginChangeCheck();
pixels = AnimancerGUI.DoSpecialFloatField(area, label, pixels, _PixelSuffixCache);
if (EditorGUI.EndChangeCheck())
value = isNormalized ? pixels * normalizeMultiplier : pixels;
EditorGUI.BeginChangeCheck();
normalized = AnimancerGUI.DoSpecialFloatField(normalizedArea, null, normalized, _NormalizedSuffixCache);
if (EditorGUI.EndChangeCheck())
value = isNormalized ? normalized : normalized / normalizeMultiplier;
return value;
}
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Preview
/************************************************************************************************************************/
private static readonly Type
DefaultEditorType = typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.SpriteInspector");
private readonly Dictionary<Object, UnityEditor.Editor>
TargetToDefaultEditor = new Dictionary<Object, UnityEditor.Editor>();
/************************************************************************************************************************/
private void InitialisePreview()
{
foreach (var target in targets)
{
if (!TargetToDefaultEditor.ContainsKey(target))
{
var editor = CreateEditor(target, DefaultEditorType);
TargetToDefaultEditor.Add(target, editor);
}
}
}
/************************************************************************************************************************/
private void CleanUpPreview()
{
foreach (var editor in TargetToDefaultEditor.Values)
DestroyImmediate(editor);
TargetToDefaultEditor.Clear();
}
/************************************************************************************************************************/
private bool TryGetDefaultEditor(out UnityEditor.Editor editor)
=> TargetToDefaultEditor.TryGetValue(target, out editor);
/************************************************************************************************************************/
/// <inheritdoc/>
public override string GetInfoString()
{
if (!TryGetDefaultEditor(out var editor))
return null;
return editor.GetInfoString();
}
/************************************************************************************************************************/
/// <inheritdoc/>
public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height)
{
if (!TryGetDefaultEditor(out var editor))
return null;
return editor.RenderStaticPreview(assetPath, subAssets, width, height);
}
/************************************************************************************************************************/
/// <inheritdoc/>
public override bool HasPreviewGUI()
{
return TryGetDefaultEditor(out var editor) && editor.HasPreviewGUI();
}
/************************************************************************************************************************/
/// <inheritdoc/>
public override void OnPreviewGUI(Rect area, GUIStyle background)
{
if (TryGetDefaultEditor(out var editor))
editor.OnPreviewGUI(area, background);
var sprite = target as Sprite;
if (sprite == null)
return;
EditorGUI.BeginChangeCheck();
FitAspectRatio(ref area, sprite);
DoPivotDotGUI(area, sprite);
if (EditorGUI.EndChangeCheck())
_HasBeenModified = true;
}
/************************************************************************************************************************/
private static void FitAspectRatio(ref Rect area, Sprite sprite)
{
var areaAspect = area.width / area.height;
var spriteAspect = sprite.rect.width / sprite.rect.height;
if (areaAspect != spriteAspect)
{
if (areaAspect > spriteAspect)
{
var width = area.height * spriteAspect;
area.x += (area.width - width) * 0.5f;
area.width = width;
}
else
{
var height = area.width / spriteAspect;
area.y += (area.height - height) * 0.5f;
area.height = height;
}
}
}
/************************************************************************************************************************/
private static readonly int PivotDotControlIDHint = "PivotDot".GetHashCode();
private static GUIStyle _PivotDot;
private static GUIStyle _PivotDotActive;
private Vector2 _MouseDownPivot;
private void DoPivotDotGUI(Rect area, Sprite sprite)
{
if (_PivotDot == null)
_PivotDot = "U2D.pivotDot";
if (_PivotDotActive == null)
_PivotDotActive = "U2D.pivotDotActive";
Vector2 pivot;
if (_Pivot.hasMultipleDifferentValues)
{
pivot = sprite.pivot;
pivot.x /= sprite.rect.width;
pivot.y /= sprite.rect.height;
}
else
{
pivot = _Pivot.vector2Value;
}
pivot.x *= area.width;
pivot.y *= area.height;
var pivotArea = new Rect(
area.x + pivot.x - _PivotDot.fixedWidth * 0.5f,
area.yMax - pivot.y - _PivotDot.fixedHeight * 0.5f,
_PivotDot.fixedWidth,
_PivotDot.fixedHeight);
var controlID = GUIUtility.GetControlID(PivotDotControlIDHint, FocusType.Keyboard);
var currentEvent = Event.current;
switch (currentEvent.GetTypeForControl(controlID))
{
case EventType.MouseDown:
if (currentEvent.button == 0 && pivotArea.Contains(Event.current.mousePosition) && !currentEvent.alt)
{
GUIUtility.hotControl = GUIUtility.keyboardControl = controlID;
_MouseDownPivot = pivot;
EditorGUIUtility.SetWantsMouseJumping(1);
currentEvent.Use();
}
break;
case EventType.MouseDrag:
if (GUIUtility.hotControl == controlID)
{
pivot = Event.current.mousePosition;
pivot.x = InverseLerpUnclamped(area.x, area.xMax, pivot.x);
pivot.y = InverseLerpUnclamped(area.yMax, area.y, pivot.y);
if (currentEvent.control)
{
pivot.x = Mathf.Round(pivot.x * sprite.rect.width) / sprite.rect.width;
pivot.y = Mathf.Round(pivot.y * sprite.rect.height) / sprite.rect.height;
}
_Pivot.vector2Value = pivot;
GUI.changed = true;
currentEvent.Use();
}
break;
case EventType.MouseUp:
if (GUIUtility.hotControl == controlID && (currentEvent.button == 0 || currentEvent.button == 2))
{
EditorGUIUtility.SetWantsMouseJumping(0);
GUIUtility.hotControl = 0;
currentEvent.Use();
}
break;
case EventType.KeyDown:
if (GUIUtility.hotControl == controlID && currentEvent.keyCode == KeyCode.Escape)
{
_Pivot.vector2Value = _MouseDownPivot;
GUIUtility.hotControl = 0;
GUI.changed = true;
currentEvent.Use();
}
break;
case EventType.Repaint:
EditorGUIUtility.AddCursorRect(pivotArea, MouseCursor.Arrow, controlID);
var style = GUIUtility.hotControl == controlID ? _PivotDotActive : _PivotDot;
style.Draw(pivotArea, GUIContent.none, controlID);
break;
}
}
/************************************************************************************************************************/
/// <summary>The opposite of <see cref="Mathf.LerpUnclamped(float, float, float)"/>.</summary>
public static float InverseLerpUnclamped(float a, float b, float value)
{
if (a == b)
return 0;
else
return (value - a) / (b - a);
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
}
}
#endif
|
jynew/jyx2/Assets/3rd/Animancer/Internal/Editor/Inspector/SpriteEditor.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Internal/Editor/Inspector/SpriteEditor.cs",
"repo_id": "jynew",
"token_count": 12097
}
| 964 |
fileFormatVersion: 2
guid: a7e12894d2c9d204ab20b16c6091b5e2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Internal/Editor/Serialization/Serialization.PropertyReference.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Internal/Editor/Serialization/Serialization.PropertyReference.cs.meta",
"repo_id": "jynew",
"token_count": 98
}
| 965 |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik //
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEngine;
namespace Animancer.Editor
{
/// <summary>[Editor-Only] [Pro-Only]
/// An <see cref="EditorWindow"/> which allows the user to preview animation transitions separately from the rest
/// of the scene in Edit Mode or Play Mode.
/// </summary>
/// <remarks>
/// Documentation: <see href="https://kybernetik.com.au/animancer/docs/manual/transitions#previews">Previews</see>
/// </remarks>
internal sealed partial class TransitionPreviewWindow : EditorWindow
{
/************************************************************************************************************************/
#region Public API
/************************************************************************************************************************/
private static Texture _Icon;
/// <summary>The icon image used by this window.</summary>
public static Texture Icon
{
get
{
if (_Icon == null)
{
// Possible icons: "UnityEditor.LookDevView", "SoftlockInline", "ViewToolOrbit".
#if UNITY_2019_3_OR_NEWER
const string IconName = "ViewToolOrbit";
#else
const string IconName = "UnityEditor.LookDevView";
#endif
_Icon = AnimancerGUI.LoadIcon(IconName);
if (_Icon == null)
_Icon = EditorGUIUtility.whiteTexture;
}
return _Icon;
}
}
/************************************************************************************************************************/
/// <summary>Focusses the <see cref="TransitionPreviewWindow"/> or creates one if none exists.</summary>
public static void Open(SerializedProperty transitionProperty, bool open)
{
if (open)
{
GetWindow<TransitionPreviewWindow>(typeof(SceneView))
.SetTargetProperty(transitionProperty);
}
else if (IsPreviewingCurrentProperty())
{
EditorApplication.delayCall += _Instance.Close;
}
}
/************************************************************************************************************************/
/// <summary>
/// The <see cref="AnimancerState.NormalizedTime"/> of the current transition. Can only be set if the property
/// being previewed matches the current <see cref="TransitionDrawer.Context"/>.
/// </summary>
public static float PreviewNormalizedTime
{
get => _Instance._Scene.NormalizedTime;
set
{
if (float.IsNaN(value) ||
!IsPreviewingCurrentProperty())
return;
_Instance._Scene.NormalizedTime = value;
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
}
}
/************************************************************************************************************************/
/// <summary>
/// Returns the <see cref="AnimancerState"/> of the current transition if the property being previewed matches
/// the <see cref="TransitionDrawer.Context"/>. Otherwise returns null.
/// </summary>
public static AnimancerState GetCurrentState()
{
if (!IsPreviewingCurrentProperty() ||
_Instance._Scene.InstanceAnimancer == null)
return null;
var transition = _Instance.GetTransition();
_Instance._Scene.InstanceAnimancer.States.TryGet(transition, out var state);
return state;
}
/************************************************************************************************************************/
/// <summary>
/// Indicates whether the current <see cref="TransitionDrawer.TransitionContext.Property"/> is being previewed
/// at the moment.
/// </summary>
public static bool IsPreviewingCurrentProperty()
{
return
_Instance != null &&
TransitionDrawer.Context != null &&
_Instance._TransitionProperty.IsValid() &&
Serialization.AreSameProperty(TransitionDrawer.Context.Property, _Instance._TransitionProperty);
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Messages
/************************************************************************************************************************/
private static TransitionPreviewWindow _Instance;
[SerializeField] private Inspector _Inspector;
[SerializeField] private Scene _Scene;
/************************************************************************************************************************/
private void OnEnable()
{
_Instance = this;
titleContent = new GUIContent("Transition Preview", Icon);
autoRepaintOnSceneChange = true;
AnimancerUtilities.NewIfNull(ref _Inspector);
AnimancerUtilities.NewIfNull(ref _Scene);
if (_TransitionProperty.IsValid() &&
!CanBePreviewed(_TransitionProperty))
{
DestroyTransitionProperty();
}
_Scene.OnEnable();
}
/************************************************************************************************************************/
private void OnDisable()
{
_Scene.OnDisable();
_Instance = null;
}
/************************************************************************************************************************/
private void OnDestroy()
{
_Scene.OnDestroy();
DestroyTransitionProperty();
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
}
/************************************************************************************************************************/
private void OnGUI()
{
// Maximising then un-maximising the window causes it to lose the _Instance for some reason.
_Instance = this;
GUILayout.BeginHorizontal();
{
_Scene.DoPreviewGUI();
_Inspector.DoInspectorGUI();
}
GUILayout.EndHorizontal();
}
/************************************************************************************************************************/
private void Update()
{
_Instance = this;
if (Settings.AutoClose && !_TransitionProperty.IsValid())
{
Close();
return;
}
_Scene.Update();
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Transition Property
/************************************************************************************************************************/
[SerializeField] private Serialization.PropertyReference _TransitionProperty;
/************************************************************************************************************************/
/// <summary>Indicates whether the `property` is able to be previewed by this system.</summary>
public static bool CanBePreviewed(SerializedProperty property)
{
var type = property.GetAccessor().FieldType;
return typeof(ITransitionDetailed).IsAssignableFrom(type);
}
/************************************************************************************************************************/
private void SetTargetProperty(SerializedProperty property)
{
if (property.serializedObject.targetObjects.Length != 1)
{
Close();
throw new ArgumentException($"{nameof(TransitionPreviewWindow)} does not support multi-object selection.");
}
if (!CanBePreviewed(property))
{
Close();
throw new ArgumentException($"The specified property does not implement {nameof(ITransitionDetailed)}.");
}
DestroyTransitionProperty();
_TransitionProperty = property;
_Scene.OnTargetPropertyChanged();
}
/************************************************************************************************************************/
private ITransitionDetailed GetTransition()
{
if (!_TransitionProperty.IsValid())
return null;
return _TransitionProperty.Property.GetValue<ITransitionDetailed>();
}
/************************************************************************************************************************/
private void DestroyTransitionProperty()
{
if (_TransitionProperty == null)
return;
_Scene.DestroyModelInstance();
_TransitionProperty.Dispose();
_TransitionProperty = null;
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
}
}
#endif
|
jynew/jyx2/Assets/3rd/Animancer/Internal/Editor/Transition Preview Window/TransitionPreviewWindow.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Internal/Editor/Transition Preview Window/TransitionPreviewWindow.cs",
"repo_id": "jynew",
"token_count": 3599
}
| 966 |
fileFormatVersion: 2
guid: 724cb07f283f36649bdaa5081690d13b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Utilities/Animation Jobs/AnimancerJob.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Utilities/Animation Jobs/AnimancerJob.cs.meta",
"repo_id": "jynew",
"token_count": 92
}
| 967 |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik //
using System;
using static UnityEngine.Mathf;
using NormalizedDelegate = System.Func<float, float>;
namespace Animancer
{
/// <summary>A set of common <see href="https://easings.net">easing functions</see>.</summary>
/// <remarks>
/// There are several different types of functions:
/// <list type="bullet">
/// <item>In: accelerating from zero velocity.</item>
/// <item>Out: decelerating to zero velocity.</item>
/// <item>InOut: uses the corresponding In function until halfway, then the Out function after that.</item>
/// <item>Normalized: methods with a single parameter (<see cref="float"/> value) expect values from 0 to 1.</item>
/// <item>Ranged: methods with 3 parameters (<see cref="float"/> start, <see cref="float"/> end,
/// <see cref="float"/> value) use the specified range instead ot 0 to 1.</item>
/// <item>Derivative: calculates the gradient of their corresponding non-derivative function.
/// The more complex derivative functions were made with 'https://www.derivative-calculator.net'.</item>
/// </list>
/// </remarks>
/// https://kybernetik.com.au/animancer/api/Animancer/Easing
///
public static class Easing
{
/************************************************************************************************************************/
#region Delegates
/************************************************************************************************************************/
/// <summary>The natural log of 2.</summary>
public const float Ln2 = 0.693147180559945f;
/************************************************************************************************************************/
/// <summary>A variant of a <see cref="NormalizedDelegate"/> with a custom range instead of 0 to 1.</summary>
public delegate float RangedDelegate(float start, float end, float value);
/************************************************************************************************************************/
/// <summary>The name of an easing function.</summary>
/// <remarks>The <see cref="Easing"/> class contains various extension methods for this enum.</remarks>
/// https://kybernetik.com.au/animancer/api/Animancer/Function
///
public enum Function
{
/// <summary><see cref="Easing.Linear(float)"/></summary>
Linear,
/// <summary><see cref="Quadratic.In(float)"/></summary>
QuadraticIn,
/// <summary><see cref="Quadratic.Out(float)"/></summary>
QuadraticOut,
/// <summary><see cref="Quadratic.InOut(float)"/></summary>
QuadraticInOut,
/// <summary><see cref="Cubic.In(float)"/></summary>
CubicIn,
/// <summary><see cref="Cubic.Out(float)"/></summary>
CubicOut,
/// <summary><see cref="Cubic.InOut(float)"/></summary>
CubicInOut,
/// <summary><see cref="Quartic.In(float)"/></summary>
QuarticIn,
/// <summary><see cref="Quartic.Out(float)"/></summary>
QuarticOut,
/// <summary><see cref="Quartic.InOut(float)"/></summary>
QuarticInOut,
/// <summary><see cref="Quintic.In(float)"/></summary>
QuinticIn,
/// <summary><see cref="Quintic.Out(float)"/></summary>
QuinticOut,
/// <summary><see cref="Quintic.InOut(float)"/></summary>
QuinticInOut,
/// <summary><see cref="Sine.In(float)"/></summary>
SineIn,
/// <summary><see cref="Sine.Out(float)"/></summary>
SineOut,
/// <summary><see cref="Sine.InOut(float)"/></summary>
SineInOut,
/// <summary><see cref="Exponential.In(float)"/></summary>
ExponentialIn,
/// <summary><see cref="Exponential.Out(float)"/></summary>
ExponentialOut,
/// <summary><see cref="Exponential.InOut(float)"/></summary>
ExponentialInOut,
/// <summary><see cref="Circular.In(float)"/></summary>
CircularIn,
/// <summary><see cref="Circular.Out(float)"/></summary>
CircularOut,
/// <summary><see cref="Circular.InOut(float)"/></summary>
CircularInOut,
/// <summary><see cref="Back.In(float)"/></summary>
BackIn,
/// <summary><see cref="Back.Out(float)"/></summary>
BackOut,
/// <summary><see cref="Back.InOut(float)"/></summary>
BackInOut,
/// <summary><see cref="Bounce.In(float)"/></summary>
BounceIn,
/// <summary><see cref="Bounce.Out(float)"/></summary>
BounceOut,
/// <summary><see cref="Bounce.InOut(float)"/></summary>
BounceInOut,
/// <summary><see cref="Elastic.In(float)"/></summary>
ElasticIn,
/// <summary><see cref="Elastic.Out(float)"/></summary>
ElasticOut,
/// <summary><see cref="Elastic.InOut(float)"/></summary>
ElasticInOut,
}
/// <summary>The total number of <see cref="Function"/> values.</summary>
public const int FunctionCount = (int)Function.ElasticInOut + 1;
/************************************************************************************************************************/
private static NormalizedDelegate[] _FunctionDelegates;
/// <summary>Returns a cached delegate representing the specified `function` with a normalized range.</summary>
public static NormalizedDelegate GetDelegate(this Function function)
{
var i = (int)function;
NormalizedDelegate del;
if (_FunctionDelegates == null)
{
_FunctionDelegates = new NormalizedDelegate[FunctionCount];
}
else
{
del = _FunctionDelegates[i];
if (del != null)
return del;
}
switch (function)
{
case Function.Linear: del = Linear; break;
case Function.QuadraticIn: del = Quadratic.In; break;
case Function.QuadraticOut: del = Quadratic.Out; break;
case Function.QuadraticInOut: del = Quadratic.InOut; break;
case Function.CubicIn: del = Cubic.In; break;
case Function.CubicOut: del = Cubic.Out; break;
case Function.CubicInOut: del = Cubic.InOut; break;
case Function.QuarticIn: del = Quartic.In; break;
case Function.QuarticOut: del = Quartic.Out; break;
case Function.QuarticInOut: del = Quartic.InOut; break;
case Function.QuinticIn: del = Quintic.In; break;
case Function.QuinticOut: del = Quintic.Out; break;
case Function.QuinticInOut: del = Quintic.InOut; break;
case Function.SineIn: del = Sine.In; break;
case Function.SineOut: del = Sine.Out; break;
case Function.SineInOut: del = Sine.InOut; break;
case Function.ExponentialIn: del = Exponential.In; break;
case Function.ExponentialOut: del = Exponential.Out; break;
case Function.ExponentialInOut: del = Exponential.InOut; break;
case Function.CircularIn: del = Circular.In; break;
case Function.CircularOut: del = Circular.Out; break;
case Function.CircularInOut: del = Circular.InOut; break;
case Function.BackIn: del = Back.In; break;
case Function.BackOut: del = Back.Out; break;
case Function.BackInOut: del = Back.InOut; break;
case Function.BounceIn: del = Bounce.In; break;
case Function.BounceOut: del = Bounce.Out; break;
case Function.BounceInOut: del = Bounce.InOut; break;
case Function.ElasticIn: del = Elastic.In; break;
case Function.ElasticOut: del = Elastic.Out; break;
case Function.ElasticInOut: del = Elastic.InOut; break;
default: throw new ArgumentOutOfRangeException(nameof(function));
}
_FunctionDelegates[i] = del;
return del;
}
/************************************************************************************************************************/
private static NormalizedDelegate[] _DerivativeDelegates;
/// <summary>Returns a cached delegate representing the derivative of the specified `function` with a normalized range.</summary>
public static NormalizedDelegate GetDerivativeDelegate(this Function function)
{
var i = (int)function;
NormalizedDelegate del;
if (_DerivativeDelegates == null)
{
_DerivativeDelegates = new NormalizedDelegate[FunctionCount];
}
else
{
del = _DerivativeDelegates[i];
if (del != null)
return del;
}
switch (function)
{
case Function.Linear: del = LinearDerivative; break;
case Function.QuadraticIn: del = Quadratic.InDerivative; break;
case Function.QuadraticOut: del = Quadratic.OutDerivative; break;
case Function.QuadraticInOut: del = Quadratic.InOutDerivative; break;
case Function.CubicIn: del = Cubic.InDerivative; break;
case Function.CubicOut: del = Cubic.OutDerivative; break;
case Function.CubicInOut: del = Cubic.InOutDerivative; break;
case Function.QuarticIn: del = Quartic.InDerivative; break;
case Function.QuarticOut: del = Quartic.OutDerivative; break;
case Function.QuarticInOut: del = Quartic.InOutDerivative; break;
case Function.QuinticIn: del = Quintic.InDerivative; break;
case Function.QuinticOut: del = Quintic.OutDerivative; break;
case Function.QuinticInOut: del = Quintic.InOutDerivative; break;
case Function.SineIn: del = Sine.InDerivative; break;
case Function.SineOut: del = Sine.OutDerivative; break;
case Function.SineInOut: del = Sine.InOutDerivative; break;
case Function.ExponentialIn: del = Exponential.InDerivative; break;
case Function.ExponentialOut: del = Exponential.OutDerivative; break;
case Function.ExponentialInOut: del = Exponential.InOutDerivative; break;
case Function.CircularIn: del = Circular.InDerivative; break;
case Function.CircularOut: del = Circular.OutDerivative; break;
case Function.CircularInOut: del = Circular.InOutDerivative; break;
case Function.BackIn: del = Back.InDerivative; break;
case Function.BackOut: del = Back.OutDerivative; break;
case Function.BackInOut: del = Back.InOutDerivative; break;
case Function.BounceIn: del = Bounce.InDerivative; break;
case Function.BounceOut: del = Bounce.OutDerivative; break;
case Function.BounceInOut: del = Bounce.InOutDerivative; break;
case Function.ElasticIn: del = Elastic.InDerivative; break;
case Function.ElasticOut: del = Elastic.OutDerivative; break;
case Function.ElasticInOut: del = Elastic.InOutDerivative; break;
default: throw new ArgumentOutOfRangeException(nameof(function));
}
_DerivativeDelegates[i] = del;
return del;
}
/************************************************************************************************************************/
private static RangedDelegate[] _RangedFunctionDelegates;
/// <summary>Returns a cached delegate representing the specified `function` with a custom range.</summary>
public static RangedDelegate GetRangedDelegate(this Function function)
{
var i = (int)function;
RangedDelegate del;
if (_RangedFunctionDelegates == null)
{
_RangedFunctionDelegates = new RangedDelegate[FunctionCount];
}
else
{
del = _RangedFunctionDelegates[i];
if (del != null)
return del;
}
switch (function)
{
case Function.Linear: del = Linear; break;
case Function.QuadraticIn: del = Quadratic.In; break;
case Function.QuadraticOut: del = Quadratic.Out; break;
case Function.QuadraticInOut: del = Quadratic.InOut; break;
case Function.CubicIn: del = Cubic.In; break;
case Function.CubicOut: del = Cubic.Out; break;
case Function.CubicInOut: del = Cubic.InOut; break;
case Function.QuarticIn: del = Quartic.In; break;
case Function.QuarticOut: del = Quartic.Out; break;
case Function.QuarticInOut: del = Quartic.InOut; break;
case Function.QuinticIn: del = Quintic.In; break;
case Function.QuinticOut: del = Quintic.Out; break;
case Function.QuinticInOut: del = Quintic.InOut; break;
case Function.SineIn: del = Sine.In; break;
case Function.SineOut: del = Sine.Out; break;
case Function.SineInOut: del = Sine.InOut; break;
case Function.ExponentialIn: del = Exponential.In; break;
case Function.ExponentialOut: del = Exponential.Out; break;
case Function.ExponentialInOut: del = Exponential.InOut; break;
case Function.CircularIn: del = Circular.In; break;
case Function.CircularOut: del = Circular.Out; break;
case Function.CircularInOut: del = Circular.InOut; break;
case Function.BackIn: del = Back.In; break;
case Function.BackOut: del = Back.Out; break;
case Function.BackInOut: del = Back.InOut; break;
case Function.BounceIn: del = Bounce.In; break;
case Function.BounceOut: del = Bounce.Out; break;
case Function.BounceInOut: del = Bounce.InOut; break;
case Function.ElasticIn: del = Elastic.In; break;
case Function.ElasticOut: del = Elastic.Out; break;
case Function.ElasticInOut: del = Elastic.InOut; break;
default: throw new ArgumentOutOfRangeException(nameof(function));
}
_RangedFunctionDelegates[i] = del;
return del;
}
/************************************************************************************************************************/
private static RangedDelegate[] _RangedDerivativeDelegates;
/// <summary>Returns a cached delegate representing the derivative of the specified `function` with a custom range.</summary>
public static RangedDelegate GetRangedDerivativeDelegate(this Function function)
{
var i = (int)function;
RangedDelegate del;
if (_RangedDerivativeDelegates == null)
{
_RangedDerivativeDelegates = new RangedDelegate[FunctionCount];
}
else
{
del = _RangedDerivativeDelegates[i];
if (del != null)
return del;
}
switch (function)
{
case Function.Linear: del = LinearDerivative; break;
case Function.QuadraticIn: del = Quadratic.InDerivative; break;
case Function.QuadraticOut: del = Quadratic.OutDerivative; break;
case Function.QuadraticInOut: del = Quadratic.InOutDerivative; break;
case Function.CubicIn: del = Cubic.InDerivative; break;
case Function.CubicOut: del = Cubic.OutDerivative; break;
case Function.CubicInOut: del = Cubic.InOutDerivative; break;
case Function.QuarticIn: del = Quartic.InDerivative; break;
case Function.QuarticOut: del = Quartic.OutDerivative; break;
case Function.QuarticInOut: del = Quartic.InOutDerivative; break;
case Function.QuinticIn: del = Quintic.InDerivative; break;
case Function.QuinticOut: del = Quintic.OutDerivative; break;
case Function.QuinticInOut: del = Quintic.InOutDerivative; break;
case Function.SineIn: del = Sine.InDerivative; break;
case Function.SineOut: del = Sine.OutDerivative; break;
case Function.SineInOut: del = Sine.InOutDerivative; break;
case Function.ExponentialIn: del = Exponential.InDerivative; break;
case Function.ExponentialOut: del = Exponential.OutDerivative; break;
case Function.ExponentialInOut: del = Exponential.InOutDerivative; break;
case Function.CircularIn: del = Circular.InDerivative; break;
case Function.CircularOut: del = Circular.OutDerivative; break;
case Function.CircularInOut: del = Circular.InOutDerivative; break;
case Function.BackIn: del = Back.InDerivative; break;
case Function.BackOut: del = Back.OutDerivative; break;
case Function.BackInOut: del = Back.InOutDerivative; break;
case Function.BounceIn: del = Bounce.InDerivative; break;
case Function.BounceOut: del = Bounce.OutDerivative; break;
case Function.BounceInOut: del = Bounce.InOutDerivative; break;
case Function.ElasticIn: del = Elastic.InDerivative; break;
case Function.ElasticOut: del = Elastic.OutDerivative; break;
case Function.ElasticInOut: del = Elastic.InOutDerivative; break;
default: throw new ArgumentOutOfRangeException(nameof(function));
}
_RangedDerivativeDelegates[i] = del;
return del;
}
/************************************************************************************************************************/
/// <summary>Returns a linearly interpolated value between the `start` and `end` based on a normalized `value`.</summary>
/// <remarks>
/// <list type="bullet">
/// <item><c>value = 0</c> returns <c>start</c>.</item>
/// <item><c>value = 0.5</c> returns <c>(start + end) / 2</c>.</item>
/// <item><c>value = 1</c> returns <c>end</c>.</item>
/// </list>
/// This method is identical to <see cref="LerpUnclamped"/>.
/// </remarks>
public static float Lerp(float start, float end, float value) => start + (end - start) * value;
/// <summary>Returns a normalized value indicating how far the `value` is between the `start` and `end`.</summary>
/// <remarks>
/// <list type="bullet">
/// <item><c>value = start</c> returns <c>0</c>.</item>
/// <item><c>value = (start + end) / 2</c> returns <c>0.5</c>.</item>
/// <item><c>value = end</c> returns <c>1</c>.</item>
/// <item><c>start = end</c> returns <c>0</c>.</item>
/// </list>
/// This method is like <see cref="InverseLerp"/> except that it doesn't clamp the result between 0 and 1.
/// </remarks>
public static float UnLerp(float start, float end, float value) => start == end ? 0 : (value - start) / (end - start);
/************************************************************************************************************************/
/// <summary>Re-scales the result of the `function` to use a custom range instead of 0 to 1.</summary>
public static float ReScale(float start, float end, float value, NormalizedDelegate function)
=> Lerp(start, end, function(UnLerp(start, end, value)));
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Linear
/************************************************************************************************************************/
/// <summary>Directly returns the `value`. Interpolates the `value` based on the line <c>y = x</c>.</summary>
public static float Linear(float value) => value;
/************************************************************************************************************************/
/// <summary>Returns 1. The derivative of <see cref="Linear(float)"/>.</summary>
public static float LinearDerivative(float value) => 1;
/************************************************************************************************************************/
/// <summary>Directly returns the `value`. Interpolates the `value` based on the line <c>y = x</c>.</summary>
public static float Linear(float start, float end, float value) => value;
/************************************************************************************************************************/
/// <summary>Returns <c>end - start</c>. The derivative of <see cref="Linear(float, float, float)"/>.</summary>
public static float LinearDerivative(float start, float end, float value) => end - start;
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Quadratic
/************************************************************************************************************************/
/// <summary>Functions based on quadratic equations (<c>x^2</c>).</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Quadratic
///
public static class Quadratic
{
/************************************************************************************************************************/
/// <summary>Interpolates the `value` based on the line <c>y = x^2</c>.</summary>
/// <remarks><see href="https://easings.net/#easeInQuad">Easings.net has a graph of this function.</see></remarks>
public static float In(float value) => value * value;
/// <summary>Interpolates the `value` based on the line <c>y = 1 - (x - 1)^2</c>.</summary>
/// <remarks><see href="https://easings.net/#easeOutQuad">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value)
{
value--;
return -value * value + 1;
}
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutQuad">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
value *= 2;
if (value <= 1)
{
return 0.5f * value * value;
}
else
{
value -= 2;
return 0.5f * (-value * value + 2);
}
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/> (<c>y = 2x</c>).</summary>
public static float InDerivative(float value) => 2 * value;
/// <summary>Returns the derivative of <see cref="Out(float)"/> (<c>y = -2x + 2</c>).</summary>
public static float OutDerivative(float value) => 2 - 2 * value;
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
{
return 2 * value;
}
else
{
value--;
return 2 - 2 * value;
}
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Cubic
/************************************************************************************************************************/
/// <summary>Functions based on cubic equations (<c>x^3</c>).</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Cubic
///
public static class Cubic
{
/************************************************************************************************************************/
/// <summary>Interpolates the `value` based on the line <c>y = x^3</c>.</summary>
/// <remarks><see href="https://easings.net/#easeInCubic">Easings.net has a graph of this function.</see></remarks>
public static float In(float value) => value * value * value;
/// <summary>Interpolates the `value` based on the line <c>y = 1 + (x - 1)^3</c>.</summary>
/// <remarks><see href="https://easings.net/#easeOutCubic">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value)
{
value--;
return value * value * value + 1;
}
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutCubic">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
value *= 2;
if (value <= 1)
{
return 0.5f * value * value * value;
}
else
{
value -= 2;
return 0.5f * (value * value * value + 2);
}
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/> (<c>y = 3x</c>).</summary>
public static float InDerivative(float value) => 3 * value * value;
/// <summary>Returns the derivative of <see cref="Out(float)"/> (<c>y = 3 * (x - 1)</c>).</summary>
public static float OutDerivative(float value)
{
value--;
return 3 * value * value;
}
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
{
return 3 * value * value;
}
else
{
value -= 2;
return 3 * value * value;
}
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Quartic
/************************************************************************************************************************/
/// <summary>Functions based on quartic equations (<c>x^4</c>).</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Quartic
///
public static class Quartic
{
/************************************************************************************************************************/
/// <summary>Interpolates the `value` based on the line <c>y = x^4</c>.</summary>
/// <remarks><see href="https://easings.net/#easeInQuart">Easings.net has a graph of this function.</see></remarks>
public static float In(float value) => value * value * value * value;
/// <summary>Interpolates the `value` based on the line <c>y = 1 - (x - 1)^4</c>.</summary>
/// <remarks><see href="https://easings.net/#easeOutQuart">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value)
{
value--;
return -value * value * value * value + 1;
}
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutQuart">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
value *= 2;
if (value <= 1)
{
return 0.5f * value * value * value * value;
}
else
{
value -= 2;
return 0.5f * (-value * value * value * value + 2);
}
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/> (<c>y = 4x</c>).</summary>
public static float InDerivative(float value) => 4 * value * value * value;
/// <summary>Returns the derivative of <see cref="Out(float)"/> (<c>y = -4 * (x - 1)</c>).</summary>
public static float OutDerivative(float value)
{
value--;
return -4 * value * value * value;
}
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
{
return 4 * value * value * value;
}
else
{
value -= 2;
return -4 * value * value * value;
}
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Quintic
/************************************************************************************************************************/
/// <summary>Functions based on quintic equations (<c>x^5</c>).</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Quintic
///
public static class Quintic
{
/************************************************************************************************************************/
/// <summary>Interpolates the `value` based on the line <c>y = x^5</c>.</summary>
/// <remarks><see href="https://easings.net/#easeInQuint">Easings.net has a graph of this function.</see></remarks>
public static float In(float value) => value * value * value * value * value;
/// <summary>Interpolates the `value` based on the line <c>y = 1 + (x - 1)^5</c>.</summary>
/// <remarks><see href="https://easings.net/#easeOutQuint">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value)
{
value--;
return value * value * value * value * value + 1;
}
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutQuint">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
value *= 2;
if (value <= 1)
{
return 0.5f * value * value * value * value * value;
}
else
{
value -= 2;
return 0.5f * (value * value * value * value * value + 2);
}
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/> (<c>y = 5x</c>).</summary>
public static float InDerivative(float value) => 5 * value * value * value * value;
/// <summary>Returns the derivative of <see cref="Out(float)"/> (<c>y = -5 * (x - 1)</c>).</summary>
public static float OutDerivative(float value)
{
value--;
return 5 * value * value * value * value;
}
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
{
return 5 * value * value * value * value;
}
else
{
value -= 2;
return 5 * value * value * value * value;
}
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Sine
/************************************************************************************************************************/
/// <summary>Functions based on sinusoidal equations.</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Sine
///
public static class Sine
{
/************************************************************************************************************************/
/// <summary>Interpolates the `value` based on a quarter-cycle of a sine wave.</summary>
/// <remarks><see href="https://easings.net/#easeInSine">Easings.net has a graph of this function.</see></remarks>
public static float In(float value) => -Cos(value * (PI * 0.5f)) + 1;
/// <summary>Interpolates the `value` based on a quarter-cycle of a sine wave.</summary>
/// <remarks><see href="https://easings.net/#easeOutSine">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value) => Sin(value * (PI * 0.5f));
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutSine">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value) => -0.5f * (Cos(PI * value) - 1);
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/>.</summary>
public static float InDerivative(float value) => 0.5f * PI * Sin(0.5f * PI * value);
/// <summary>Returns the derivative of <see cref="Out(float)"/>.</summary>
public static float OutDerivative(float value) => PI * 0.5f * Cos(value * (PI * 0.5f));
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value) => 0.5f * PI * Sin(PI * value);
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Exponential
/************************************************************************************************************************/
/// <summary>Functions based on exponential equations (<c>2^(10(x))</c>).</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Exponential
///
public static class Exponential
{
/************************************************************************************************************************/
/// <summary>Interpolates the `value` based on the line (<c>y = 2^(10 * (x - 1))</c>).</summary>
/// <remarks><see href="https://easings.net/#easeInExpo">Easings.net has a graph of this function.</see></remarks>
public static float In(float value) => Pow(2, 10 * (value - 1));
/// <summary>Interpolates the `value` based on the line (<c>y = -2^(-10x) + 1</c>).</summary>
/// <remarks><see href="https://easings.net/#easeOutExpo">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value) => -Pow(2, -10 * value) + 1;
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutExpo">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
value *= 2;
if (value <= 1)
{
return 0.5f * Pow(2, 10 * (value - 1));
}
else
{
value--;
return 0.5f * (-Pow(2, -10 * value) + 2);
}
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/> (<c>y = 10 * ln(2) * 2^(10 * (x - 1))</c>).</summary>
public static float InDerivative(float value) => 10 * Ln2 * Pow(2, 10 * (value - 1));
/// <summary>Returns the derivative of <see cref="Out(float)"/> (<c>y = 5 * ln(2) * 2^(-10 * (x - 1) + 1)</c>).</summary>
public static float OutDerivative(float value) => 5 * Ln2 * Pow(2, 1 - 10 * value);
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
{
return 10 * Ln2 * Pow(2, 10 * (value - 1));
}
else
{
value--;
return 5 * Ln2 * Pow(2, 1 - 10 * value);
}
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Circular
/************************************************************************************************************************/
/// <summary>Functions based on circular equations.</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Circular
///
public static class Circular
{
/************************************************************************************************************************/
/// <summary>Interpolates the `value` based on a shifted quadrant IV of a unit circle.</summary>
/// <remarks><see href="https://easings.net/#easeInCirc">Easings.net has a graph of this function.</see></remarks>
public static float In(float value) => -(Sqrt(1 - value * value) - 1);
/// <summary>Interpolates the `value` based on a shifted quadrant II of a unit circle.</summary>
/// <remarks><see href="https://easings.net/#easeOutCirc">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value)
{
value--;
return Sqrt(1 - value * value);
}
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutCirc">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
value *= 2;
if (value <= 1)
{
return -0.5f * (Sqrt(1 - value * value) - 1);
}
else
{
value -= 2;
return 0.5f * (Sqrt(1 - value * value) + 1);
}
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/>.</summary>
public static float InDerivative(float value) => value / Sqrt(1 - value * value);
/// <summary>Returns the derivative of <see cref="Out(float)"/>.</summary>
public static float OutDerivative(float value)
{
value--;
return -value / Sqrt(1 - value * value);
}
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
{
return value / (2 * Sqrt(1 - value * value));
}
else
{
value -= 2;
return -value / (2 * Sqrt(1 - value * value));
}
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Back
/************************************************************************************************************************/
/// <summary>Functions based on equations which go out of bounds then come back.</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Back
///
public static class Back
{
/************************************************************************************************************************/
private const float C = 1.758f;
/************************************************************************************************************************/
/// <remarks><see href="https://easings.net/#easeInBack">Easings.net has a graph of this function.</see></remarks>
public static float In(float value) => value * value * ((C + 1) * value - C);
/// <remarks><see href="https://easings.net/#easeOutBack">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value)
{
value -= 1;
return value * value * ((C + 1) * value + C) + 1;
}
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutBack">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
value *= 2;
if (value <= 1)
{
return 0.5f * value * value * ((C + 1) * value - C);
}
else
{
value -= 2;
return 0.5f * (value * value * ((C + 1) * value + C) + 2);
}
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/>.</summary>
public static float InDerivative(float value) => 3 * (C + 1) * value * value - 2 * C * value;
/// <summary>Returns the derivative of <see cref="Out(float)"/>.</summary>
public static float OutDerivative(float value)
{
value -= 1;
return (C + 1) * value * value + 2 * value * ((C + 1) * value + C);
}
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
{
return 3 * (C + 1) * value * value - 2 * C * value;
}
else
{
value -= 2;
return (C + 1) * value * value + 2 * value * ((C + 1) * value + C);
}
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Bounce
/************************************************************************************************************************/
/// <summary>Functions based on equations with sharp bounces.</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Bounce
///
public static class Bounce
{
/************************************************************************************************************************/
/// <remarks><see href="https://easings.net/#easeInBounce">Easings.net has a graph of this function.</see></remarks>
public static float In(float value)
{
return 1 - Out(1 - value);
}
/// <remarks><see href="https://easings.net/#easeOutBounce">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value)
{
switch (value)
{
case 0: return 0;
case 1: return 1;
}
if (value < (1f / 2.75f))
{
return 7.5625f * value * value;
}
else if (value < (2f / 2.75f))
{
value -= 1.5f / 2.75f;
return 7.5625f * value * value + 0.75f;
}
else if (value < (2.5f / 2.75f))
{
value -= 2.25f / 2.75f;
return 7.5625f * value * value + 0.9375f;
}
else
{
value -= 2.625f / 2.75f;
return 7.5625f * value * value + 0.984375f;
}
}
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutBounce">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
if (value < 0.5f)
return 0.5f * In(value * 2);
else
return 0.5f + 0.5f * Out(value * 2 - 1);
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/>.</summary>
public static float InDerivative(float value) => OutDerivative(1 - value);
/// <summary>Returns the derivative of <see cref="Out(float)"/>.</summary>
public static float OutDerivative(float value)
{
if (value < (1f / 2.75f))
{
return 2 * 7.5625f * value;
}
else if (value < (2f / 2.75f))
{
value -= 1.5f / 2.75f;
return 2 * 7.5625f * value;
}
else if (value < (2.5f / 2.75f))
{
value -= 2.25f / 2.75f;
return 2 * 7.5625f * value;
}
else
{
value -= 2.625f / 2.75f;
return 2 * 7.5625f * value;
}
}
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
return OutDerivative(1 - value);
else
return OutDerivative(value - 1);
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
#region Elastic
/************************************************************************************************************************/
/// <summary>Functions based on equations with soft bounces.</summary>
/// https://kybernetik.com.au/animancer/api/Animancer/Elastic
///
public static class Elastic
{
/************************************************************************************************************************/
/// <summary><c>2 / 3 * pi</c></summary>
public const float TwoThirdsPi = 2f / 3f * PI;
/************************************************************************************************************************/
/// <remarks><see href="https://easings.net/#easeInElastic">Easings.net has a graph of this function.</see></remarks>
public static float In(float value)
{
switch (value)
{
case 0: return 0;
case 1: return 1;
}
return -Pow(2, 10 * value - 10) * Sin((value * 10 - 10.75f) * TwoThirdsPi);
}
/// <remarks><see href="https://easings.net/#easeOutElastic">Easings.net has a graph of this function.</see></remarks>
public static float Out(float value)
{
switch (value)
{
case 0: return 0;
case 1: return 1;
}
return 1 + Pow(2, -10 * value) * Sin((value * -10 - 0.75f) * TwoThirdsPi);
}
/// <summary>Interpolate using <see cref="In"/> (0 to 0.5) or <see cref="Out"/> (0.5 to 1).</summary>
/// <remarks><see href="https://easings.net/#easeInOutElastic">Easings.net has a graph of this function.</see></remarks>
public static float InOut(float value)
{
switch (value)
{
case 0: return 0;
case 0.5f: return 0.5f;
case 1: return 1;
}
value *= 2;
if (value <= 1)
{
return 0.5f * (-Pow(2, 10 * value - 10) * Sin((value * 10 - 10.75f) * TwoThirdsPi));
}
else
{
value--;
return 0.5f + 0.5f * (1 + Pow(2, -10 * value) * Sin((value * -10 - 0.75f) * TwoThirdsPi));
}
}
/************************************************************************************************************************/
/// <summary>Returns the derivative of <see cref="In(float)"/>.</summary>
public static float InDerivative(float value)
{
return -(5 * Pow(2, 10 * value - 9) *
(3 * Ln2 * Sin(PI * (40 * value - 43) / 6) +
2 * PI * Cos(PI * (40 * value - 43) / 6))) / 3;
}
/// <summary>Returns the derivative of <see cref="Out(float)"/>.</summary>
public static float OutDerivative(float value)
{
return -(30 * Ln2 * Sin(2 * PI * (10 * value - 3f / 4f) / 3) -
20 * PI * Cos(2 * PI * (10 * value - 3f / 4f) / 3)) /
(3 * Pow(2, 10 * value));
}
/// <summary>Returns the derivative of <see cref="InOut(float)"/>.</summary>
public static float InOutDerivative(float value)
{
value *= 2;
if (value <= 1)
return OutDerivative(1 - value);
else
return OutDerivative(value - 1);
}
/************************************************************************************************************************/
// Ranged Variants.
/************************************************************************************************************************/
/// <summary>A variant of <see cref="In(float)"/> with a custom range instead of 0 to 1.</summary>
public static float In(float start, float end, float value) => Lerp(start, end, In(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="Out(float)"/> with a custom range instead of 0 to 1.</summary>
public static float Out(float start, float end, float value) => Lerp(start, end, Out(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InOut(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOut(float start, float end, float value) => Lerp(start, end, InOut(UnLerp(start, end, value)));
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InDerivative(float start, float end, float value) => InDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float OutDerivative(float start, float end, float value) => OutDerivative(UnLerp(start, end, value)) * (end - start);
/// <summary>A variant of <see cref="InDerivative(float)"/> with a custom range instead of 0 to 1.</summary>
public static float InOutDerivative(float start, float end, float value) => InOutDerivative(UnLerp(start, end, value)) * (end - start);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endregion
/************************************************************************************************************************/
}
}
|
jynew/jyx2/Assets/3rd/Animancer/Utilities/Custom Fade/Easing.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Utilities/Custom Fade/Easing.cs",
"repo_id": "jynew",
"token_count": 30236
}
| 968 |
fileFormatVersion: 2
guid: 44bb48284153d6e498f900eb062fc584
labels:
- FSM
- FiniteStateMachine
- Interface
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Animancer/Utilities/FSM/IState.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Utilities/FSM/IState.cs.meta",
"repo_id": "jynew",
"token_count": 108
}
| 969 |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik //
using UnityEngine;
namespace Animancer
{
/// <summary>A <see cref="ScriptableObject"/> which holds a <see cref="Float1ControllerState.Transition"/>.</summary>
/// <remarks>
/// Documentation: <see href="https://kybernetik.com.au/animancer/docs/manual/transitions/types#transition-assets">Transition Assets</see>
/// </remarks>
/// https://kybernetik.com.au/animancer/api/Animancer/Float1ControllerTransition
///
[CreateAssetMenu(menuName = Strings.MenuPrefix + "Controller Transition/Float 1", order = Strings.AssetMenuOrder + 5)]
[HelpURL(Strings.DocsURLs.APIDocumentation + "/" + nameof(Float1ControllerTransition))]
public class Float1ControllerTransition : AnimancerTransition<Float1ControllerState.Transition> { }
}
|
jynew/jyx2/Assets/3rd/Animancer/Utilities/Transitions/Float1ControllerTransition.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Animancer/Utilities/Transitions/Float1ControllerTransition.cs",
"repo_id": "jynew",
"token_count": 276
}
| 970 |
fileFormatVersion: 2
guid: 81ce3127d24a5454ea888b42effc7133
folderAsset: yes
timeCreated: 1449420072
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Demigiant/DemiLib/Core.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Demigiant/DemiLib/Core.meta",
"repo_id": "jynew",
"token_count": 73
}
| 971 |
fileFormatVersion: 2
guid: b9a01c13744d8a948a160308103f4d2a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Example Materials - Ultra Fast Android/Fast Water Material - OpenGLES 2.0 HQ B.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Example Materials - Ultra Fast Android/Fast Water Material - OpenGLES 2.0 HQ B.asset.meta",
"repo_id": "jynew",
"token_count": 77
}
| 972 |
fileFormatVersion: 2
guid: b3fd336dd99c58744b49bc03e19c43ff
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Example Materials - Ultra Fast Android/Fast Water Material - OpenGLES 2.0 LQ E.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Example Materials - Ultra Fast Android/Fast Water Material - OpenGLES 2.0 LQ E.asset.meta",
"repo_id": "jynew",
"token_count": 74
}
| 973 |
Shader "Hidden/EM-X/ChannerRemover"
{
Properties{
_MainTex("Texture", Any) = "white" {}
_Mask("Mask", Color) = (1,1,1,1)
}
CGINCLUDE
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
struct appdata_t {
float4 vertex : POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f {
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float2 clipUV : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
uniform float4 _Mask;
uniform float4 _MainTex_ST;
uniform fixed4 _Color;
uniform float4x4 unity_GUIClipTextureMatrix;
v2f vert(appdata_t v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
float3 eyePos = UnityObjectToViewPos(v.vertex);
o.clipUV = mul(unity_GUIClipTextureMatrix, float4(eyePos.xy, 0, 1.0));
o.color = v.color;
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
return o;
}
uniform bool _ManualTex2SRGB;
sampler2D _MainTex;
sampler2D _GUIClipTexture;
fixed4 frag(v2f i) : SV_Target
{
fixed4 colTex = tex2D(_MainTex, i.texcoord);
if (_ManualTex2SRGB)
colTex.rgb = LinearToGammaSpace(colTex.rgb);
fixed4 col;
col.rgb = colTex.rgb * i.color.rgb;
fixed alpha = i.color.a * tex2D(_GUIClipTexture, i.clipUV).a;
if (_Mask.r == 0 || _Mask.g == 0 || _Mask.b == 0 || _Mask.a == 0) {
fixed t = 0;
if (_Mask.r != 0) t = colTex.r;
else if (_Mask.g != 0) t = colTex.g;
else if (_Mask.b != 0) t = colTex.b;
else if (_Mask.a != 0) t = colTex.a;
t *= i.color.rgb;
return fixed4(t, t, t, alpha);
}
return float4(col.rgb, alpha);
//return float4(col.rgb, tex2D(_GUIClipTexture, i.texcoord).a * alpha);
}
ENDCG
SubShader {
Tags{ "ForceSupported" = "True" }
Lighting Off
Blend SrcAlpha OneMinusSrcAlpha, One One
Cull Off
ZWrite Off
ZTest Always
Pass{
CGPROGRAM
ENDCG
}
}
SubShader {
Tags{ "ForceSupported" = "True" }
Lighting Off
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
ZWrite Off
ZTest Always
Pass{
CGPROGRAM
ENDCG
}
}
}
|
jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Scripts/GUI/Editor/Fast Water Model 2.0 ChannelsRemover.shader/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Scripts/GUI/Editor/Fast Water Model 2.0 ChannelsRemover.shader",
"repo_id": "jynew",
"token_count": 1011
}
| 974 |
fileFormatVersion: 2
guid: 190b38601c73ecb4d86364db68a3dd72
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Scripts/Shaders/EModules Water Model 2.0 v1.cginc.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Scripts/Shaders/EModules Water Model 2.0 v1.cginc.meta",
"repo_id": "jynew",
"token_count": 78
}
| 975 |
fileFormatVersion: 2
guid: e5483aa3d127d984cbe58f65d558af99
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Scripts/Shaders/EModules Water Model Test Support 128 Block Instructions.mat.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Scripts/Shaders/EModules Water Model Test Support 128 Block Instructions.mat.meta",
"repo_id": "jynew",
"token_count": 74
}
| 976 |
fileFormatVersion: 2
guid: 9843a8149ee0fd948a67602de088158d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Textures/_Utility.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/Textures/_Utility.meta",
"repo_id": "jynew",
"token_count": 67
}
| 977 |
{
"name": "AssemblyPostProcessing"
}
|
jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/__ (optional) __ Default Unity PostProcessing 2.0 - 30.08.2018/AssemblyPostProcessing.asmdef/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EModules/Fast Water Model 2.0/__ (optional) __ Default Unity PostProcessing 2.0 - 30.08.2018/AssemblyPostProcessing.asmdef",
"repo_id": "jynew",
"token_count": 18
}
| 978 |
/***********************************************
EasyTouch V
Copyright © 2014-2015 The Hedgehog Team
http://www.thehedgehogteam.com/Forum/
[email protected]
**********************************************/
using UnityEngine;
using System.Collections;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using HedgehogTeam.EasyTouch;
namespace HedgehogTeam.EasyTouch{
[AddComponentMenu("EasyTouch/Quick Drag")]
public class QuickDrag: QuickBase {
#region Events
[System.Serializable] public class OnDragStart : UnityEvent<Gesture>{}
[System.Serializable] public class OnDrag : UnityEvent<Gesture>{}
[System.Serializable] public class OnDragEnd : UnityEvent<Gesture>{}
[SerializeField]
public OnDragStart onDragStart;
[SerializeField]
public OnDrag onDrag;
[SerializeField]
public OnDragEnd onDragEnd;
#endregion
#region Members
public bool isStopOncollisionEnter = false;
private Vector3 deltaPosition;
private bool isOnDrag = false;
private Gesture lastGesture;
#endregion
#region Monobehaviour CallBack
public QuickDrag(){
quickActionName = "QuickDrag"+ System.Guid.NewGuid().ToString().Substring(0,7);
axesAction = AffectedAxesAction.XY;
}
public override void OnEnable(){
base.OnEnable();
EasyTouch.On_TouchStart += On_TouchStart;
EasyTouch.On_TouchDown += On_TouchDown;
EasyTouch.On_TouchUp += On_TouchUp;
EasyTouch.On_Drag += On_Drag;
EasyTouch.On_DragStart += On_DragStart;
EasyTouch.On_DragEnd += On_DragEnd;
}
public override void OnDisable(){
base.OnDisable();
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_TouchStart -= On_TouchStart;
EasyTouch.On_TouchDown -= On_TouchDown;
EasyTouch.On_TouchUp -= On_TouchUp;
EasyTouch.On_Drag -= On_Drag;
EasyTouch.On_DragStart -= On_DragStart;
EasyTouch.On_DragEnd -= On_DragEnd;
}
void OnCollisionEnter(){
if (isStopOncollisionEnter && isOnDrag){
StopDrag();
}
}
#endregion
#region EasyTouch Event
void On_TouchStart (Gesture gesture){
if ( realType == GameObjectType.UI){
if (gesture.isOverGui ){
if ((gesture.pickedUIElement == gameObject || gesture.pickedUIElement.transform.IsChildOf( transform)) && fingerIndex==-1){
fingerIndex = gesture.fingerIndex;
transform.SetAsLastSibling();
onDragStart.Invoke(gesture);
isOnDrag = true;
}
}
}
}
void On_TouchDown (Gesture gesture){
if (isOnDrag && fingerIndex == gesture.fingerIndex && realType == GameObjectType.UI){
if (gesture.isOverGui ){
if ((gesture.pickedUIElement == gameObject || gesture.pickedUIElement.transform.IsChildOf( transform)) ){
transform.position += (Vector3)gesture.deltaPosition;
if (gesture.deltaPosition != Vector2.zero){
onDrag.Invoke(gesture);
}
lastGesture = gesture;
}
}
}
}
void On_TouchUp (Gesture gesture){
if (fingerIndex == gesture.fingerIndex && realType == GameObjectType.UI){
lastGesture = gesture;
StopDrag();
}
}
// At the drag beginning
void On_DragStart( Gesture gesture){
if (realType != GameObjectType.UI){
if ((!enablePickOverUI && gesture.pickedUIElement == null) || enablePickOverUI){
if (gesture.pickedObject == gameObject && !isOnDrag){
isOnDrag = true;
fingerIndex = gesture.fingerIndex;
// the world coordinate from touch
Vector3 position = gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
deltaPosition = position - transform.position;
//
if (resetPhysic){
if (cachedRigidBody){
cachedRigidBody.isKinematic = true;
}
if (cachedRigidBody2D){
cachedRigidBody2D.isKinematic = true;
}
}
onDragStart.Invoke(gesture);
}
}
}
}
// During the drag
void On_Drag(Gesture gesture){
if (fingerIndex == gesture.fingerIndex){
if (realType == GameObjectType.Obj_2D || realType == GameObjectType.Obj_3D){
// Verification that the action on the object
if (gesture.pickedObject == gameObject && fingerIndex == gesture.fingerIndex){
// the world coordinate from touch
Vector3 position = gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position)-deltaPosition;
transform.position = GetPositionAxes( position);
if (gesture.deltaPosition != Vector2.zero){
onDrag.Invoke(gesture);
}
lastGesture = gesture;
}
}
}
}
// End of drag
void On_DragEnd(Gesture gesture){
if (fingerIndex == gesture.fingerIndex){
lastGesture = gesture;
StopDrag();
}
}
#endregion
#region Private Method
private Vector3 GetPositionAxes(Vector3 position){
Vector3 axes = position;
switch (axesAction){
case AffectedAxesAction.X:
axes = new Vector3(position.x,transform.position.y,transform.position.z);
break;
case AffectedAxesAction.Y:
axes = new Vector3(transform.position.x,position.y,transform.position.z);
break;
case AffectedAxesAction.Z:
axes = new Vector3(transform.position.x,transform.position.y,position.z);
break;
case AffectedAxesAction.XY:
axes = new Vector3(position.x,position.y,transform.position.z);
break;
case AffectedAxesAction.XZ:
axes = new Vector3(position.x,transform.position.y,position.z);
break;
case AffectedAxesAction.YZ:
axes = new Vector3(transform.position.x,position.y,position.z);
break;
}
return axes;
}
#endregion
#region Public Method
public void StopDrag(){
fingerIndex = -1;
if (resetPhysic){
if (cachedRigidBody){
cachedRigidBody.isKinematic = isKinematic;
}
if (cachedRigidBody2D){
cachedRigidBody2D.isKinematic = isKinematic2D;
}
}
isOnDrag = false;
onDragEnd.Invoke(lastGesture);
}
#endregion
}
}
|
jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouch/Plugins/Components/QuickDrag.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouch/Plugins/Components/QuickDrag.cs",
"repo_id": "jynew",
"token_count": 2235
}
| 979 |
fileFormatVersion: 2
guid: 120ecfbfbf21dd042bd7a4989263f1dc
folderAsset: yes
timeCreated: 1435661089
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouch/Plugins/Editor.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouch/Plugins/Editor.meta",
"repo_id": "jynew",
"token_count": 75
}
| 980 |
fileFormatVersion: 2
guid: 963a6fd84b5553a49a198120ed07763a
timeCreated: 1450161932
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouch/Plugins/Editor/QuickEnterExitInspector.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouch/Plugins/Editor/QuickEnterExitInspector.cs.meta",
"repo_id": "jynew",
"token_count": 99
}
| 981 |
fileFormatVersion: 2
guid: 7a327bf4ee8bb3744a089ef5f375ed89
folderAsset: yes
timeCreated: 1445346784
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Documentation.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Documentation.meta",
"repo_id": "jynew",
"token_count": 75
}
| 982 |
/***********************************************
EasyTouch Controls
Copyright © 2016 The Hedgehog Team
http://www.thehedgehogteam.com/Forum/
[email protected]
**********************************************/
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using System.Collections;
using System.Collections.Generic;
[System.Serializable]
public abstract class ETCBase : MonoBehaviour {
#region Enumeration
public enum ControlType {Joystick, TouchPad, DPad, Button};
public enum RectAnchor { UserDefined,BottomLeft,BottomCenter,BottonRight,CenterLeft,Center,CenterRight,TopLeft,TopCenter, TopRight};
public enum DPadAxis{ Two_Axis, Four_Axis };
public enum CameraMode{ Follow, SmoothFollow};
public enum CameraTargetMode{ UserDefined, LinkOnTag,FromDirectActionAxisX, FromDirectActionAxisY};
#endregion
#region Members
protected RectTransform cachedRectTransform;
protected Canvas cachedRootCanvas;
#region general propertie
public bool isUnregisterAtDisable = false;
private bool visibleAtStart = true;
private bool activatedAtStart = true;
[SerializeField]
protected RectAnchor _anchor;
public RectAnchor anchor {
get {
return _anchor;
}
set {
if (value != _anchor){
_anchor = value;
SetAnchorPosition();
}
}
}
[SerializeField]
protected Vector2 _anchorOffet;
public Vector2 anchorOffet {
get {
return _anchorOffet;
}
set {
if (value != _anchorOffet){
_anchorOffet = value;
SetAnchorPosition();
}
}
}
[SerializeField]
protected bool _visible;
public bool visible {
get {
return _visible;
}
set {
if (value != _visible){
_visible = value;
SetVisible();
}
}
}
[SerializeField]
protected bool _activated;
public bool activated {
get {
return _activated;
}
set {
if (value != _activated){
_activated = value;
SetActivated();
}
}
}
#endregion
#region Camera
public bool enableCamera=false;
public CameraMode cameraMode;
public string camTargetTag ="Player";
public bool autoLinkTagCam = true;
public string autoCamTag ="MainCamera";
public Transform cameraTransform;
public CameraTargetMode cameraTargetMode;
public bool enableWallDetection =false;
public LayerMask wallLayer = 0;
public Transform cameraLookAt;
protected CharacterController cameraLookAtCC;
public Vector3 followOffset = new Vector3(0,6,-6);
public float followDistance = 10;
public float followHeight = 5;
public float followRotationDamping=5;
public float followHeightDamping=5;
#endregion
#region Other
public int pointId=-1;
public bool enableKeySimulation;
public bool allowSimulationStandalone;
public bool visibleOnStandalone = true;
public DPadAxis dPadAxisCount;
public bool useFixedUpdate;
private List<RaycastResult> uiRaycastResultCache= new List<RaycastResult>();
private PointerEventData uiPointerEventData;
private EventSystem uiEventSystem;
public bool isOnDrag;
public bool isSwipeIn;
public bool isSwipeOut;
#endregion
#region Inspector
public bool showPSInspector;
public bool showSpriteInspector;
public bool showEventInspector;
public bool showBehaviourInspector;
public bool showAxesInspector;
public bool showTouchEventInspector;
public bool showDownEventInspector;
public bool showPressEventInspector;
public bool showCameraInspector;
#endregion
#endregion
#region Monobehaviour callback
protected virtual void Awake(){
cachedRectTransform = transform as RectTransform;
cachedRootCanvas = transform.parent.GetComponent<Canvas>();
#if (!UNITY_EDITOR)
if (!allowSimulationStandalone){
enableKeySimulation = false;
}
#endif
visibleAtStart = _visible;
activatedAtStart = _activated;
if (!isUnregisterAtDisable){
ETCInput.instance.RegisterControl( this);
}
}
public virtual void Start(){
if (enableCamera){
if (autoLinkTagCam){
cameraTransform = null;
GameObject tmpobj = GameObject.FindGameObjectWithTag(autoCamTag);
if (tmpobj){
cameraTransform = tmpobj.transform;
}
}
}
}
public virtual void OnEnable(){
if (isUnregisterAtDisable){
ETCInput.instance.RegisterControl( this);
}
visible = visibleAtStart;
activated = activatedAtStart;
}
void OnDisable(){
if (ETCInput._instance ){
if (isUnregisterAtDisable){
ETCInput.instance.UnRegisterControl( this );
}
}
visibleAtStart = _visible;
activated = _activated;
visible = false;
activated = false;
}
void OnDestroy(){
if (ETCInput._instance){
ETCInput.instance.UnRegisterControl( this );
}
}
public virtual void Update(){
if (!useFixedUpdate){
// StartCoroutine (UpdateVirtualControl());
DoActionBeforeEndOfFrame();
}
}
public virtual void FixedUpdate(){
if (useFixedUpdate){
//StartCoroutine (FixedUpdateVirtualControl());
DoActionBeforeEndOfFrame();
//UpdateControlState();
}
}
public virtual void LateUpdate(){
if (enableCamera){
// find camera
if (autoLinkTagCam && cameraTransform==null){
//cameraTransform = null;
GameObject tmpobj = GameObject.FindGameObjectWithTag(autoCamTag);
if (tmpobj){
cameraTransform = tmpobj.transform;
}
}
switch (cameraMode){
case CameraMode.Follow:
CameraFollow();
break;
case CameraMode.SmoothFollow:
CameraSmoothFollow();
break;
}
}
UpdateControlState();
}
#endregion
#region Virtual & public
protected virtual void UpdateControlState(){
}
protected virtual void SetVisible(bool forceUnvisible=true){
}
protected virtual void SetActivated(){
}
public void SetAnchorPosition(){
switch (_anchor){
case RectAnchor.TopLeft:
this.rectTransform().anchorMin = new Vector2(0,1);
this.rectTransform().anchorMax = new Vector2(0,1);
this.rectTransform().anchoredPosition = new Vector2( this.rectTransform().sizeDelta.x/2f + _anchorOffet.x, -this.rectTransform().sizeDelta.y/2f - _anchorOffet.y);
break;
case RectAnchor.TopCenter:
this.rectTransform().anchorMin = new Vector2(0.5f,1);
this.rectTransform().anchorMax = new Vector2(0.5f,1);
this.rectTransform().anchoredPosition = new Vector2( _anchorOffet.x, -this.rectTransform().sizeDelta.y/2f - _anchorOffet.y);
break;
case RectAnchor.TopRight:
this.rectTransform().anchorMin = new Vector2(1,1);
this.rectTransform().anchorMax = new Vector2(1,1);
this.rectTransform().anchoredPosition = new Vector2( -this.rectTransform().sizeDelta.x/2f - _anchorOffet.x, -this.rectTransform().sizeDelta.y/2f - _anchorOffet.y);
break;
case RectAnchor.CenterLeft:
this.rectTransform().anchorMin = new Vector2(0,0.5f);
this.rectTransform().anchorMax = new Vector2(0,0.5f);
this.rectTransform().anchoredPosition = new Vector2( this.rectTransform().sizeDelta.x/2f + _anchorOffet.x, _anchorOffet.y);
break;
case RectAnchor.Center:
this.rectTransform().anchorMin = new Vector2(0.5f,0.5f);
this.rectTransform().anchorMax = new Vector2(0.5f,0.5f);
this.rectTransform().anchoredPosition = new Vector2( _anchorOffet.x, _anchorOffet.y);
break;
case RectAnchor.CenterRight:
this.rectTransform().anchorMin = new Vector2(1,0.5f);
this.rectTransform().anchorMax = new Vector2(1,0.5f);
this.rectTransform().anchoredPosition = new Vector2( -this.rectTransform().sizeDelta.x/2f - _anchorOffet.x, _anchorOffet.y);
break;
case RectAnchor.BottomLeft:
this.rectTransform().anchorMin = new Vector2(0,0);
this.rectTransform().anchorMax = new Vector2(0,0);
this.rectTransform().anchoredPosition = new Vector2( this.rectTransform().sizeDelta.x/2f + _anchorOffet.x, this.rectTransform().sizeDelta.y/2f + _anchorOffet.y);
break;
case RectAnchor.BottomCenter:
this.rectTransform().anchorMin = new Vector2(0.5f,0);
this.rectTransform().anchorMax = new Vector2(0.5f,0);
this.rectTransform().anchoredPosition = new Vector2( _anchorOffet.x, this.rectTransform().sizeDelta.y/2f + _anchorOffet.y);
break;
case RectAnchor.BottonRight:
this.rectTransform().anchorMin = new Vector2(1,0);
this.rectTransform().anchorMax = new Vector2(1,0);
this.rectTransform().anchoredPosition = new Vector2( -this.rectTransform().sizeDelta.x/2f - _anchorOffet.x, this.rectTransform().sizeDelta.y/2f + _anchorOffet.y);
break;
}
}
protected GameObject GetFirstUIElement( Vector2 position){
uiEventSystem = EventSystem.current;
if (uiEventSystem != null){
uiPointerEventData = new PointerEventData( uiEventSystem);
uiPointerEventData.position = position;
uiEventSystem.RaycastAll( uiPointerEventData, uiRaycastResultCache);
if (uiRaycastResultCache.Count>0){
return uiRaycastResultCache[0].gameObject;
}
else{
return null;
}
}
else{
return null;
}
}
#endregion
#region Private Method
protected void CameraSmoothFollow(){
if (!cameraTransform || !cameraLookAt ) return ;
float wantedRotationAngle = cameraLookAt.eulerAngles.y;
float wantedHeight = cameraLookAt.position.y + followHeight;
float currentRotationAngle = cameraTransform.eulerAngles.y;
float currentHeight = cameraTransform.position.y;
currentRotationAngle = Mathf.LerpAngle(currentRotationAngle, wantedRotationAngle, followRotationDamping * Time.deltaTime);
currentHeight = Mathf.Lerp(currentHeight, wantedHeight, followHeightDamping * Time.deltaTime);
Quaternion currentRotation = Quaternion.Euler(0, currentRotationAngle, 0);
Vector3 newPos = cameraLookAt.position;
newPos -= currentRotation * Vector3.forward * followDistance;
newPos = new Vector3(newPos.x ,currentHeight , newPos.z);
if (enableWallDetection){
RaycastHit wallHit;
if (Physics.Linecast( new Vector3(cameraLookAt.position.x,cameraLookAt.position.y+1f,cameraLookAt.position.z),newPos, out wallHit)){
newPos= new Vector3( wallHit.point.x, currentHeight,wallHit.point.z);
}
}
cameraTransform.position = newPos;
cameraTransform.LookAt(cameraLookAt);
}
protected void CameraFollow(){
if (!cameraTransform || !cameraLookAt ) return ;
Vector3 localOffset = followOffset;
//if (cameraLookAtCC){
cameraTransform.position = cameraLookAt.position + localOffset;
cameraTransform.LookAt( cameraLookAt.position);
//}
//else{
//}
}
IEnumerator UpdateVirtualControl() {
DoActionBeforeEndOfFrame();
yield return new WaitForEndOfFrame();
UpdateControlState();
}
IEnumerator FixedUpdateVirtualControl() {
DoActionBeforeEndOfFrame();
yield return new WaitForFixedUpdate();
UpdateControlState();
}
protected virtual void DoActionBeforeEndOfFrame(){
}
#endregion
}
|
jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Plugins/ETCBase.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Plugins/ETCBase.cs",
"repo_id": "jynew",
"token_count": 3924
}
| 983 |
fileFormatVersion: 2
guid: bc25b1314a32d914e8f5ccc1f2e1b7c4
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
|
jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Plugins/Editor/ETCAxisInspector.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Plugins/Editor/ETCAxisInspector.cs.meta",
"repo_id": "jynew",
"token_count": 76
}
| 984 |
fileFormatVersion: 2
guid: 4a716f41b548ebf4e9a46c1acd760526
folderAsset: yes
timeCreated: 1453702052
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Prefab.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Prefab.meta",
"repo_id": "jynew",
"token_count": 79
}
| 985 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &119338
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 22495772}
- component: {fileID: 22380746}
- component: {fileID: 11441084}
- component: {fileID: 11496422}
m_Layer: 0
m_Name: ThirdPersonControllerDungeon+Jump
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &163108
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 22446594}
- component: {fileID: 22292728}
- component: {fileID: 11425804}
m_Layer: 0
m_Name: Thumb
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &172918
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 22449270}
- component: {fileID: 11482732}
- component: {fileID: 22213952}
- component: {fileID: 11420270}
m_Layer: 0
m_Name: Button jump
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &199954
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 22458898}
- component: {fileID: 11433156}
- component: {fileID: 22549932}
- component: {fileID: 22254854}
- component: {fileID: 11492898}
m_Layer: 0
m_Name: Joystick
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &11420270
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 172918}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300006, guid: becfdeef1534456438d787466a94d207, type: 3}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11425804
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 163108}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300002, guid: becfdeef1534456438d787466a94d207, type: 3}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11433156
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 199954}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c26c7a0dcd8138d4194e0a4435a4740c, type: 3}
m_Name:
m_EditorClassIdentifier:
isUnregisterAtDisable: 0
_anchor: 1
_anchorOffet: {x: 50, y: 50}
_visible: 1
_activated: 1
enableCamera: 1
cameraMode: 0
camTargetTag: Player
autoLinkTagCam: 1
autoCamTag: MainCamera
cameraTransform: {fileID: 0}
cameraTargetMode: 1
enableWallDetection: 0
wallLayer:
serializedVersion: 2
m_Bits: 0
cameraLookAt: {fileID: 0}
followOffset: {x: 0, y: 4, z: -4}
followDistance: 3.5
followHeight: 1.5
followRotationDamping: 6
followHeightDamping: 6
pointId: -1
enableKeySimulation: 1
allowSimulationStandalone: 0
visibleOnStandalone: 1
dPadAxisCount: 0
useFixedUpdate: 0
isOnDrag: 0
isSwipeIn: 0
isSwipeOut: 0
showPSInspector: 0
showSpriteInspector: 0
showEventInspector: 0
showBehaviourInspector: 0
showAxesInspector: 1
showTouchEventInspector: 0
showDownEventInspector: 0
showPressEventInspector: 0
showCameraInspector: 1
onMoveStart:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnMoveStartHandler, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
onMove:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnMoveHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
onMoveSpeed:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnMoveSpeedHandler, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
onMoveEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnMoveEndHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
onTouchStart:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnTouchStartHandler, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
onTouchUp:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnTouchUpHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnDownUp:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnDownUpHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnDownDown:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnDownDownHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnDownLeft:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnDownLeftHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnDownRight:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnDownRightHandler, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnPressUp:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnDownUpHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnPressDown:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnDownDownHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnPressLeft:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnDownLeftHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnPressRight:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCJoystick+OnDownRightHandler, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
joystickType: 1
allowJoystickOverTouchPad: 0
radiusBase: 0
radiusBaseValue: 0
axisX:
name: Horizontal
autoLinkTagPlayer: 1
autoTag: Player
player: {fileID: 0}
enable: 1
invertedAxis: 0
speed: 200
deadValue: 0.1
valueMethod: 0
curveValue:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 0
m_PostInfinity: 0
m_RotationOrder: 4
isEnertia: 0
inertia: 0
inertiaThreshold: 0.08
isAutoStab: 0
autoStabThreshold: 0.01
autoStabSpeed: 10
isClampRotation: 0
maxAngle: 90
minAngle: 90
isValueOverTime: 0
overTimeStep: 1
maxOverTimeValue: 1
axisValue: 0
axisSpeedValue: 0
axisThreshold: 0.5
isLockinJump: 0
axisState: 0
_directTransform: {fileID: 0}
directAction: 1
axisInfluenced: 1
actionOn: 1
directCharacterController: {fileID: 0}
directRigidBody: {fileID: 0}
gravity: 0
currentGravity: 0
isJump: 0
unityAxis: Horizontal
showGeneralInspector: 0
showDirectInspector: 1
showInertiaInspector: 0
showSimulatinInspector: 0
axisY:
name: Vertical
autoLinkTagPlayer: 1
autoTag: Player
player: {fileID: 0}
enable: 1
invertedAxis: 0
speed: 12
deadValue: 0.1
valueMethod: 0
curveValue:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 0
m_PostInfinity: 0
m_RotationOrder: 4
isEnertia: 0
inertia: 0
inertiaThreshold: 0.08
isAutoStab: 0
autoStabThreshold: 0.01
autoStabSpeed: 10
isClampRotation: 0
maxAngle: 90
minAngle: 90
isValueOverTime: 0
overTimeStep: 1
maxOverTimeValue: 1
axisValue: 0
axisSpeedValue: 0
axisThreshold: 0.5
isLockinJump: 0
axisState: 0
_directTransform: {fileID: 0}
directAction: 3
axisInfluenced: 2
actionOn: 1
directCharacterController: {fileID: 0}
directRigidBody: {fileID: 0}
gravity: 0
currentGravity: 0
isJump: 0
unityAxis: Vertical
showGeneralInspector: 0
showDirectInspector: 1
showInertiaInspector: 0
showSimulatinInspector: 0
thumb: {fileID: 22446594}
joystickArea: 1
userArea: {fileID: 0}
isTurnAndMove: 1
tmSpeed: 10
tmAdditionnalRotation: 0
tmMoveCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 0
m_PostInfinity: 0
m_RotationOrder: 4
tmLockInJump: 0
isNoReturnThumb: 0
isNoOffsetThumb: 0
--- !u!114 &11441084
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 119338}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!114 &11482732
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 172918}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba60450c5a1202b41869d8ee7136c85f, type: 3}
m_Name:
m_EditorClassIdentifier:
isUnregisterAtDisable: 0
_anchor: 3
_anchorOffet: {x: 50, y: 50}
_visible: 1
_activated: 1
enableCamera: 0
cameraMode: 0
camTargetTag: Player
autoLinkTagCam: 1
autoCamTag: MainCamera
cameraTransform: {fileID: 0}
cameraTargetMode: 0
enableWallDetection: 0
wallLayer:
serializedVersion: 2
m_Bits: 0
cameraLookAt: {fileID: 0}
followOffset: {x: 0, y: 6, z: -6}
followDistance: 10
followHeight: 5
followRotationDamping: 5
followHeightDamping: 5
pointId: -1
enableKeySimulation: 1
allowSimulationStandalone: 0
visibleOnStandalone: 1
dPadAxisCount: 0
useFixedUpdate: 0
isOnDrag: 0
isSwipeIn: 0
isSwipeOut: 0
showPSInspector: 1
showSpriteInspector: 0
showEventInspector: 0
showBehaviourInspector: 1
showAxesInspector: 0
showTouchEventInspector: 0
showDownEventInspector: 0
showPressEventInspector: 0
showCameraInspector: 0
onDown:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCButton+OnDownHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
onPressed:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCButton+OnPressedHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
onPressedValue:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCButton+OnPressedValueandler, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
onUp:
m_PersistentCalls:
m_Calls: []
m_TypeName: ETCButton+OnUPHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
axis:
name: Button jump
autoLinkTagPlayer: 1
autoTag: Player
player: {fileID: 0}
enable: 1
invertedAxis: 0
speed: 6
deadValue: 0.1
valueMethod: 0
curveValue:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
isEnertia: 0
inertia: 0
inertiaThreshold: 0.08
isAutoStab: 0
autoStabThreshold: 0.01
autoStabSpeed: 10
isClampRotation: 0
maxAngle: 90
minAngle: 90
isValueOverTime: 0
overTimeStep: 1
maxOverTimeValue: 1
axisValue: 0
axisSpeedValue: 0
axisThreshold: 0.5
isLockinJump: 0
axisState: 0
_directTransform: {fileID: 0}
directAction: 9
axisInfluenced: 0
actionOn: 0
directCharacterController: {fileID: 0}
directRigidBody: {fileID: 0}
gravity: 9.81
currentGravity: 0
isJump: 0
unityAxis: Jump
showGeneralInspector: 1
showDirectInspector: 1
showInertiaInspector: 0
showSimulatinInspector: 0
normalSprite: {fileID: 21300006, guid: becfdeef1534456438d787466a94d207, type: 3}
normalColor: {r: 1, g: 1, b: 1, a: 1}
pressedSprite: {fileID: 21300008, guid: becfdeef1534456438d787466a94d207, type: 3}
pressedColor: {r: 1, g: 1, b: 1, a: 1}
--- !u!114 &11492898
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 199954}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: becfdeef1534456438d787466a94d207, type: 3}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11496422
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 119338}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!222 &22213952
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 172918}
--- !u!222 &22254854
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 199954}
--- !u!222 &22292728
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 163108}
--- !u!223 &22380746
Canvas:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 119338}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &22446594
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 163108}
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: []
m_Father: {fileID: 22458898}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 80, y: 79.68749}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &22449270
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 172918}
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: []
m_Father: {fileID: 22495772}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -100, y: 100}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &22458898
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 199954}
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: 22446594}
m_Father: {fileID: 22495772}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 115, y: 114.866806}
m_SizeDelta: {x: 130, y: 129.73361}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &22495772
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 119338}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 22458898}
- {fileID: 22449270}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!225 &22549932
CanvasGroup:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 199954}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 119338}
m_IsPrefabParent: 1
|
jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Prefab/ThirdPersonControllerDungeon+Jump.prefab/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/EasyTouchBundle/EasyTouchControls/Prefab/ThirdPersonControllerDungeon+Jump.prefab",
"repo_id": "jynew",
"token_count": 8633
}
| 986 |
// Unlit map preview shader. Based on Unity's "Unlit/Texture". Version 1.3
// - no lighting
// - no lightmap support
// - no per-material color
Shader "Hidden/nu Assets/UI/CanvasOpaque"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_OffsetX ("Offset X", Float) = 0
_OffsetY ("Offset Y", Float) = 0
_Tile ("Tiling", Float) = 1
_SeamColor ("Zoom", Color) = (1,1,1,0.0)
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
#include "UnityCG.cginc"
#include "CanvasUtil.cginc"
fixed4 frag (v2f i) : SV_Target
{
half2 uv = TransformUV(i.texcoord);
fixed4 col = tex2D(_MainTex, uv);
col = DrawSeam(uv, col);
col = ClampClipSpace(uv, col);
return col;
}
ENDCG
}
}
}
|
jynew/jyx2/Assets/3rd/Editor Default Resources/nu Assets/Shared/Shaders/CanvasOpaque.shader/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Editor Default Resources/nu Assets/Shared/Shaders/CanvasOpaque.shader",
"repo_id": "jynew",
"token_count": 420
}
| 987 |
fileFormatVersion: 2
guid: 701e03f060f995f4eb3657eaef88c7b1
folderAsset: yes
timeCreated: 1434121282
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Editor Default Resources/nu Assets/Shared/UI/Icons.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Editor Default Resources/nu Assets/Shared/UI/Icons.meta",
"repo_id": "jynew",
"token_count": 76
}
| 988 |
fileFormatVersion: 2
guid: c32fb586c9cf2254fb76bce30073ed4e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/GameObjectBrush/GameObject Brush v3.3.pdf.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/GameObjectBrush/GameObject Brush v3.3.pdf.meta",
"repo_id": "jynew",
"token_count": 63
}
| 989 |
fileFormatVersion: 2
guid: d8d6ace14daff924c9a1b1b00b2cb388
timeCreated: 1525536111
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/GameObjectBrush/Prefabs/Cube Green.prefab.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/GameObjectBrush/Prefabs/Cube Green.prefab.meta",
"repo_id": "jynew",
"token_count": 91
}
| 990 |
fileFormatVersion: 2
guid: e11335c4251119447bef97729e45fa7c
folderAsset: yes
timeCreated: 1525355865
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/GameObjectBrush/Scripts/Editor.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/GameObjectBrush/Scripts/Editor.meta",
"repo_id": "jynew",
"token_count": 82
}
| 991 |
fileFormatVersion: 2
guid: 41cd2401d126859418d064ea8f4fee8c
timeCreated: 1554524255
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Lean/Common/Examples/Materials/Grid.mat.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Lean/Common/Examples/Materials/Grid.mat.meta",
"repo_id": "jynew",
"token_count": 80
}
| 992 |
fileFormatVersion: 2
guid: 5abc7d04fb72cf144ba346589c56bff3
folderAsset: yes
timeCreated: 1553134942
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Lean/Common/Examples/Prefabs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Lean/Common/Examples/Prefabs.meta",
"repo_id": "jynew",
"token_count": 75
}
| 993 |
using UnityEngine;
using UnityEngine.EventSystems;
namespace Lean.Common.Examples
{
/// <summary>This component allows you to open a URL using Unity events (e.g. a button).</summary>
[ExecuteInEditMode]
[AddComponentMenu("Lean/Common/Lean Link To")]
public class LeanLinkTo : MonoBehaviour, IPointerClickHandler
{
public enum LinkType
{
Publisher,
PreviousScene,
NextScene
}
/// <summary>The URL that will be opened.</summary>
public LinkType Link { set { link = value; } get { return link; } } [SerializeField] private LinkType link;
protected virtual void Update()
{
switch (link)
{
case LinkType.PreviousScene:
case LinkType.NextScene:
{
var group = GetComponent<CanvasGroup>();
if (group != null)
{
var show = GetCurrentLevel() >= 0 && GetLevelCount() > 1;
group.alpha = show == true ? 1.0f : 0.0f;
group.blocksRaycasts = show;
group.interactable = show;
}
}
break;
}
}
public void OnPointerClick(PointerEventData eventData)
{
switch (link)
{
case LinkType.Publisher:
{
Application.OpenURL("http://carloswilkes.com");
}
break;
case LinkType.PreviousScene:
{
var index = GetCurrentLevel();
if (index >= 0)
{
if (--index < 0)
{
index = GetLevelCount() - 1;
}
LoadLevel(index);
}
}
break;
case LinkType.NextScene:
{
var index = GetCurrentLevel();
if (index >= 0)
{
if (++index >= GetLevelCount())
{
index = 0;
}
LoadLevel(index);
}
}
break;
}
}
private static int GetCurrentLevel()
{
var scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
var index = scene.buildIndex;
if (index >= 0)
{
if (UnityEngine.SceneManagement.SceneManager.GetSceneByBuildIndex(index).path != scene.path)
{
return -1;
}
}
return index;
}
private static int GetLevelCount()
{
return UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings;
}
private static void LoadLevel(int index)
{
UnityEngine.SceneManagement.SceneManager.LoadScene(index);
}
}
}
#if UNITY_EDITOR
namespace Lean.Common.Examples
{
using UnityEditor;
[CanEditMultipleObjects]
[CustomEditor(typeof(LeanLinkTo))]
public class LeanLinkTo_Editor : LeanInspector<LeanLinkTo>
{
protected override void DrawInspector()
{
base.DrawInspector();
}
}
}
#endif
|
jynew/jyx2/Assets/3rd/Lean/Common/Examples/Scripts/LeanLinkTo.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Lean/Common/Examples/Scripts/LeanLinkTo.cs",
"repo_id": "jynew",
"token_count": 1060
}
| 994 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &109124
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 440512}
- component: {fileID: 3398218}
- component: {fileID: 6529974}
- component: {fileID: 2380200}
- component: {fileID: 5470336}
- component: {fileID: 11446884}
- component: {fileID: 114965158223696112}
m_Layer: 0
m_Name: Rigidbody Cube + LeanPooledRigidbody
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &440512
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 109124}
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: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &2380200
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 109124}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c4dab12b6ad08384ba8a3ce2f7eba5f7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &3398218
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 109124}
m_Mesh: {fileID: 4300002, guid: f36c148914c8e05498dad1ca7becaa2e, type: 3}
--- !u!54 &5470336
Rigidbody:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 109124}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!65 &6529974
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 109124}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &11446884
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 109124}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a47bac80a21a18b4b91b990df1cb4e7a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 109124}
m_IsPrefabParent: 1
--- !u!114 &114965158223696112
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 109124}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9a59bf981769e4a4f9230599cab9261a, type: 3}
m_Name:
m_EditorClassIdentifier:
cachedPool: {fileID: 0}
|
jynew/jyx2/Assets/3rd/Lean/Pool/Examples/Media/Rigidbody Cube + LeanPooledRigidbody.prefab/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Lean/Pool/Examples/Media/Rigidbody Cube + LeanPooledRigidbody.prefab",
"repo_id": "jynew",
"token_count": 1653
}
| 995 |
fileFormatVersion: 2
guid: 174bc9f391f1b7f4292b3824c5019a21
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/Lean/Pool/LeanPool.asmdef.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/Lean/Pool/LeanPool.asmdef.meta",
"repo_id": "jynew",
"token_count": 66
}
| 996 |
fileFormatVersion: 2
guid: 0ff24322cd7026c40b89fae1b4ba3f65
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/EditorResources.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/EditorResources.meta",
"repo_id": "jynew",
"token_count": 70
}
| 997 |
fileFormatVersion: 2
guid: a3b911875dbcafa4a83aff32c3cfad50
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/EditorResources/Shaders.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/EditorResources/Shaders.meta",
"repo_id": "jynew",
"token_count": 69
}
| 998 |
fileFormatVersion: 2
guid: 3a51cdfed4ecfb449833c729867fb1d7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor.meta",
"repo_id": "jynew",
"token_count": 70
}
| 999 |
fileFormatVersion: 2
guid: 8379f1f06b9b2574da42a8c96f498708
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor/GrassPainter/GrassDetailListBox.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor/GrassPainter/GrassDetailListBox.cs.meta",
"repo_id": "jynew",
"token_count": 95
}
| 1,000 |
fileFormatVersion: 2
guid: 4cd3db011f7d43d4fa898352d4b12bd4
timeCreated: 1506096871
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor/GrassPainter/GrassType.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor/GrassPainter/GrassType.cs.meta",
"repo_id": "jynew",
"token_count": 102
}
| 1,001 |
fileFormatVersion: 2
guid: 4bfabf1e6f848f8468ce0040e61661f9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor/ObjectPainter/ObjectPainter.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor/ObjectPainter/ObjectPainter.cs.meta",
"repo_id": "jynew",
"token_count": 96
}
| 1,002 |
fileFormatVersion: 2
guid: 53a0eeb066394c045855f04320e87c76
timeCreated: 1480766048
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor/SplatPainter/TextureModifyGroup.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Editor/SplatPainter/TextureModifyGroup.cs.meta",
"repo_id": "jynew",
"token_count": 101
}
| 1,003 |
fileFormatVersion: 2
guid: 4d3eb4889975685449bb771ac79419c7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Scripts/Compatibility.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Scripts/Compatibility.meta",
"repo_id": "jynew",
"token_count": 66
}
| 1,004 |
{
"name": "MTE_script",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Scripts/MTE_script.asmdef/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Scripts/MTE_script.asmdef",
"repo_id": "jynew",
"token_count": 129
}
| 1,005 |
fileFormatVersion: 2
guid: 30c66cbd259e55744ae4c865d937a593
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Scripts/TextureArray/TextureLayer.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Plugins/Scripts/TextureArray/TextureLayer.cs.meta",
"repo_id": "jynew",
"token_count": 94
}
| 1,006 |
fileFormatVersion: 2
guid: c77d032dc4baf7c4f8226156d4a055ef
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Specialized/Mali 400/ReadMe.txt.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Specialized/Mali 400/ReadMe.txt.meta",
"repo_id": "jynew",
"token_count": 66
}
| 1,007 |
fileFormatVersion: 2
guid: 6ca09bd11ce5cb34abdc9e98c1c3bf31
folderAsset: yes
timeCreated: 1494496943
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Standard/2Textures.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Standard/2Textures.meta",
"repo_id": "jynew",
"token_count": 76
}
| 1,008 |
fileFormatVersion: 2
guid: 040df5903d077d94584f02baef683411
timeCreated: 1495893263
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Standard/4Textures/Bumped.shader.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Standard/4Textures/Bumped.shader.meta",
"repo_id": "jynew",
"token_count": 77
}
| 1,009 |
Shader "MTE/Standard/5 Textures/Display Normal"
{
Properties
{
_Control ("Control (RGBA)", 2D) = "red" {}
[NoScaleOffset]_ControlExtra ("Control Extra (R)", 2D) = "black" {}
_Splat0 ("Layer 1", 2D) = "white" {}
_Splat1 ("Layer 2", 2D) = "white" {}
_Splat2 ("Layer 3", 2D) = "white" {}
_Splat3 ("Layer 4", 2D) = "white" {}
_Splat4 ("Layer 5", 2D) = "white" {}
[NoScaleOffset]_Normal0 ("Normalmap 1", 2D) = "bump" {}
[NoScaleOffset]_Normal1 ("Normalmap 2", 2D) = "bump" {}
[NoScaleOffset]_Normal2 ("Normalmap 3", 2D) = "bump" {}
[NoScaleOffset]_Normal3 ("Normalmap 4", 2D) = "bump" {}
[NoScaleOffset]_Normal4 ("Normalmap 5", 2D) = "bump" {}
}
CGINCLUDE
#pragma surface surf NoLighting nofog noambient noforwardadd vertex:MTE_SplatmapVert
#pragma exclude_renderers d3d9 gles//TextureArray is not available on d3d9 and gles2
//#pragma enable_d3d11_debug_symbols //for debug
struct Input
{
float2 tc_Control : TEXCOORD0;
float4 tc_Splat01 : TEXCOORD1;
float4 tc_Splat23 : TEXCOORD2;
};
#define MTE_STANDARD_SHADER
#include "UnityPBSLighting.cginc"
#include "../../MTECommon.hlsl"
sampler2D _Control,_ControlExtra;
float4 _Control_ST,_ControlExtra_ST;
sampler2D _Splat0,_Splat1,_Splat2,_Splat3,_Splat4;
sampler2D _Normal0,_Normal1,_Normal2,_Normal3,_Normal4;
float4 _Splat0_ST,_Splat1_ST,_Splat2_ST,_Splat3_ST;
void MTE_SplatmapVert(inout appdata_full v, out Input data)
{
UNITY_INITIALIZE_OUTPUT(Input, data);
data.tc_Control.xy = TRANSFORM_TEX(v.texcoord, _Control);
data.tc_Splat01.xy = TRANSFORM_TEX(v.texcoord, _Splat0);
data.tc_Splat01.zw = TRANSFORM_TEX(v.texcoord, _Splat1);
data.tc_Splat23.xy = TRANSFORM_TEX(v.texcoord, _Splat2);
data.tc_Splat23.zw = TRANSFORM_TEX(v.texcoord, _Splat3);
//Splat4 shares texcoord with Splat3 - both using tc_Splat23.zw.
}
void MTE_SplatmapMix(Input IN, out half4 packedNormal)
{
half4 splat_control = tex2D(_Control, IN.tc_Control.xy);
half4 splat_control_extra = tex2D(_ControlExtra, IN.tc_Control.xy);
half4 nrm = 0.0f;
nrm += splat_control.r * tex2D(_Normal0, IN.tc_Splat01.xy);
nrm += splat_control.g * tex2D(_Normal1, IN.tc_Splat01.zw);
nrm += splat_control.b * tex2D(_Normal2, IN.tc_Splat23.xy);
nrm += splat_control.a * tex2D(_Normal3, IN.tc_Splat23.zw);
nrm += splat_control_extra.r * tex2D(_Normal4, IN.tc_Splat23.zw);
packedNormal = nrm;
}
void surf(Input IN, inout SurfaceOutput o)
{
half4 packedNormal;
MTE_SplatmapMix(IN, packedNormal);
half3 normal = UnpackNormal(packedNormal);
o.Albedo.rgb = normal.rgb*0.5+0.5;
o.Alpha = 1.0;
}
half4 LightingNoLighting(SurfaceOutput s, half3 lightDir, half atten)
{
return half4(s.Albedo, s.Alpha);
}
ENDCG
Category
{
Tags
{
"Queue" = "Geometry-99"
"RenderType" = "Opaque"
}
SubShader
{
CGPROGRAM
#pragma target 4.0
ENDCG
}
}
Fallback "Diffuse"
}
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Standard/5Textures/DisplayNormal.shader/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Standard/5Textures/DisplayNormal.shader",
"repo_id": "jynew",
"token_count": 1389
}
| 1,010 |
fileFormatVersion: 2
guid: 74ff00419dd299646a41ebb049b42b03
folderAsset: yes
timeCreated: 1474333936
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/2Textures.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/2Textures.meta",
"repo_id": "jynew",
"token_count": 74
}
| 1,011 |
//NOTE Use corresponding target 2.0 shader if you need to use this shader on lower-end devices that only support OpenGLES 2.0.
Shader "MTE/Surface/3 Textures/Specular"
{
Properties
{
_SpecColor("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
_Shininess("Shininess", Range(0.03, 1)) = 0.078125
_Control ("Control (RGBA)", 2D) = "red" {}
_Splat0 ("Layer 1", 2D) = "white" {}
_Splat1 ("Layer 2", 2D) = "white" {}
_Splat2 ("Layer 3", 2D) = "white" {}
_Normal0 ("Normalmap 1", 2D) = "bump" {}
_Normal1 ("Normalmap 2", 2D) = "bump" {}
_Normal2 ("Normalmap 3", 2D) = "bump" {}
[Toggle(ENABLE_NORMAL_INTENSITY)] ENABLE_NORMAL_INTENSITY ("Normal Intensity", Float) = 0
_NormalIntensity0 ("Normal Intensity 0", Range(0.01, 10)) = 1.0
_NormalIntensity1 ("Normal Intensity 1", Range(0.01, 10)) = 1.0
_NormalIntensity2 ("Normal Intensity 2", Range(0.01, 10)) = 1.0
}
CGINCLUDE
#pragma surface surf BlinnPhong vertex:MTE_SplatmapVert finalcolor:MTE_SplatmapFinalColor finalprepass:MTE_SplatmapFinalPrepass finalgbuffer:MTE_SplatmapFinalGBuffer
#pragma multi_compile_fog
#pragma shader_feature ENABLE_NORMAL_INTENSITY
struct Input
{
float4 tc_ControlSplat0 : TEXCOORD0;
float4 tc_Splat12 : TEXCOORD1;
UNITY_FOG_COORDS(2)
};
sampler2D _Control;
float4 _Control_ST;
sampler2D _Splat0,_Splat1,_Splat2;
float4 _Splat0_ST,_Splat1_ST,_Splat2_ST;
sampler2D _Normal0,_Normal1,_Normal2;
#ifdef ENABLE_NORMAL_INTENSITY
fixed _NormalIntensity0, _NormalIntensity1, _NormalIntensity2;
#endif
#include "../../MTECommon.hlsl"
half _Shininess;
void MTE_SplatmapVert(inout appdata_full v, out Input data)
{
UNITY_INITIALIZE_OUTPUT(Input, data);
data.tc_ControlSplat0.xy = TRANSFORM_TEX(v.texcoord, _Control);
data.tc_ControlSplat0.zw = TRANSFORM_TEX(v.texcoord, _Splat0);
data.tc_Splat12.xy = TRANSFORM_TEX(v.texcoord, _Splat1);
data.tc_Splat12.zw = TRANSFORM_TEX(v.texcoord, _Splat2);
float4 pos = UnityObjectToClipPos (v.vertex);
UNITY_TRANSFER_FOG(data, pos);
v.tangent.xyz = cross(v.normal, float3(0,0,1));
v.tangent.w = -1;
}
void MTE_SplatmapMix(Input IN, out half weight, out fixed4 mixedDiffuse, inout fixed3 mixedNormal)
{
half4 splat_control = tex2D(_Control, IN.tc_ControlSplat0.xy);
weight = dot(splat_control, half4(1, 1, 1, 1));
splat_control /= (weight + 1e-3f);
mixedDiffuse = 0.0f;
mixedDiffuse += splat_control.r * tex2D(_Splat0, IN.tc_ControlSplat0.zw);
mixedDiffuse += splat_control.g * tex2D(_Splat1, IN.tc_Splat12.xy);
mixedDiffuse += splat_control.b * tex2D(_Splat2, IN.tc_Splat12.zw);
#ifdef ENABLE_NORMAL_INTENSITY
fixed3 nrm0 = UnpackNormal(tex2D(_Normal0, IN.tc_ControlSplat0.zw));
fixed3 nrm1 = UnpackNormal(tex2D(_Normal1, IN.tc_Splat12.xy));
fixed3 nrm2 = UnpackNormal(tex2D(_Normal2, IN.tc_Splat12.zw));
nrm0 = splat_control.r * MTE_NormalIntensity_fixed(nrm0, _NormalIntensity0);
nrm1 = splat_control.g * MTE_NormalIntensity_fixed(nrm1, _NormalIntensity1);
nrm2 = splat_control.b * MTE_NormalIntensity_fixed(nrm2, _NormalIntensity2);
mixedNormal = normalize(nrm0 + nrm1 + nrm2);
#else
fixed4 nrm = 0.0f;
nrm += splat_control.r * tex2D(_Normal0, IN.tc_ControlSplat0.zw);
nrm += splat_control.g * tex2D(_Normal1, IN.tc_Splat12.xy);
nrm += splat_control.b * tex2D(_Normal2, IN.tc_Splat12.zw);
mixedNormal = UnpackNormal(nrm);
#endif
}
void surf(Input IN, inout SurfaceOutput o)
{
fixed4 mixedDiffuse;
half weight;
MTE_SplatmapMix(IN, weight, mixedDiffuse, o.Normal);
o.Albedo = mixedDiffuse.rgb;
o.Alpha = weight;
o.Gloss = mixedDiffuse.a;
o.Specular = _Shininess;
}
ENDCG
Category
{
Tags
{
"Queue" = "Geometry-99"
"RenderType" = "Opaque"
}
SubShader//for target 3.0+
{
CGPROGRAM
#pragma target 3.0
ENDCG
}
}
Fallback "MTE/Surface/3 Textures/Bumped"
CustomEditor "MTE.MTEShaderGUI"
}
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/3Textures/Specular.shader/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/3Textures/Specular.shader",
"repo_id": "jynew",
"token_count": 1797
}
| 1,012 |
fileFormatVersion: 2
guid: 784b2a1548f964a4fa3045828e98b8cd
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/4Textures/Specular_for_target_2.0.shader.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/4Textures/Specular_for_target_2.0.shader.meta",
"repo_id": "jynew",
"token_count": 81
}
| 1,013 |
Shader "MTE/Surface/5 Textures/Specular/Fog"
{
Properties
{
_SpecColor("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
_Shininess("Shininess", Range(0.03, 1)) = 0.078125
_Control ("Control (RGBA)", 2D) = "red" {}
_ControlExtra ("Control Extra (R)", 2D) = "black" {}
_Splat0 ("Layer 1", 2D) = "white" {}
_Splat1 ("Layer 2", 2D) = "white" {}
_Splat2 ("Layer 3", 2D) = "white" {}
_Splat3 ("Layer 4", 2D) = "white" {}
_Splat4 ("Layer 5", 2D) = "white" {}
_Normal0 ("Normalmap 1", 2D) = "bump" {}
_Normal1 ("Normalmap 2", 2D) = "bump" {}
_Normal2 ("Normalmap 3", 2D) = "bump" {}
_Normal3 ("Normalmap 4", 2D) = "bump" {}
_Normal4 ("Normalmap 5", 2D) = "bump" {}
[Toggle(ENABLE_NORMAL_INTENSITY)] ENABLE_NORMAL_INTENSITY ("Normal Intensity", Float) = 0
_NormalIntensity0 ("Normal Intensity 0", Range(0.01, 10)) = 1.0
_NormalIntensity1 ("Normal Intensity 1", Range(0.01, 10)) = 1.0
_NormalIntensity2 ("Normal Intensity 2", Range(0.01, 10)) = 1.0
_NormalIntensity3 ("Normal Intensity 3", Range(0.01, 10)) = 1.0
_NormalIntensity4 ("Normal Intensity 4", Range(0.01, 10)) = 1.0
}
CGINCLUDE
#pragma surface surf BlinnPhong vertex:MTE_SplatmapVert finalcolor:MTE_SplatmapFinalColor finalprepass:MTE_SplatmapFinalPrepass finalgbuffer:MTE_SplatmapFinalGBuffer
#pragma multi_compile_fog
#pragma shader_feature ENABLE_NORMAL_INTENSITY
struct Input
{
float2 tc_Control : TEXCOORD0;
float4 tc_Splat01 : TEXCOORD1;
float4 tc_Splat23 : TEXCOORD2;
UNITY_FOG_COORDS(3)
};
sampler2D _Control,_ControlExtra;
float4 _Control_ST,_ControlExtra_ST;
sampler2D _Splat0,_Splat1,_Splat2,_Splat3,_Splat4;
float4 _Splat0_ST,_Splat1_ST,_Splat2_ST,_Splat3_ST;
sampler2D _Normal0,_Normal1,_Normal2,_Normal3,_Normal4;
#ifdef ENABLE_NORMAL_INTENSITY
fixed _NormalIntensity0, _NormalIntensity1, _NormalIntensity2, _NormalIntensity3,
_NormalIntensity4;
#endif
#include "../../MTECommon.hlsl"
half _Shininess;
void MTE_SplatmapVert(inout appdata_full v, out Input data)
{
UNITY_INITIALIZE_OUTPUT(Input, data);
data.tc_Control.xy = TRANSFORM_TEX(v.texcoord, _Control);
data.tc_Splat01.xy = TRANSFORM_TEX(v.texcoord, _Splat0);
data.tc_Splat01.zw = TRANSFORM_TEX(v.texcoord, _Splat1);
data.tc_Splat23.xy = TRANSFORM_TEX(v.texcoord, _Splat2);
data.tc_Splat23.zw = TRANSFORM_TEX(v.texcoord, _Splat3);
// Because the UNITY_FOG_COORDS(3) occupied one TEXCOORD, Splat4 have to share texcoord with Splat3 - both using tc_Splat23.zw.
float4 pos = UnityObjectToClipPos (v.vertex);
UNITY_TRANSFER_FOG(data, pos);
v.tangent.xyz = cross(v.normal, float3(0,0,1));
v.tangent.w = -1;
}
void MTE_SplatmapMix(Input IN, out half weight, out fixed4 mixedDiffuse, inout fixed3 mixedNormal)
{
half4 splat_control = tex2D(_Control, IN.tc_Control.xy);
half4 splat_control_extra = tex2D(_ControlExtra, IN.tc_Control.xy);
weight = dot(splat_control, half4(1, 1, 1, 1));
weight += dot(splat_control_extra.r, half(1));
splat_control /= (weight + 1e-3f);
splat_control_extra /= (weight + 1e-3f);
mixedDiffuse = 0;
mixedDiffuse += splat_control.r * tex2D(_Splat0, IN.tc_Splat01.xy);
mixedDiffuse += splat_control.g * tex2D(_Splat1, IN.tc_Splat01.zw);
mixedDiffuse += splat_control.b * tex2D(_Splat2, IN.tc_Splat23.xy);
mixedDiffuse += splat_control.a * tex2D(_Splat3, IN.tc_Splat23.zw);
mixedDiffuse += splat_control_extra.r * tex2D(_Splat4, IN.tc_Splat23.zw);
#ifdef ENABLE_NORMAL_INTENSITY
fixed3 nrm0 = UnpackNormal(tex2D(_Normal0, IN.tc_Splat01.xy));
fixed3 nrm1 = UnpackNormal(tex2D(_Normal1, IN.tc_Splat01.xy));
fixed3 nrm2 = UnpackNormal(tex2D(_Normal2, IN.tc_Splat23.xy));
fixed3 nrm3 = UnpackNormal(tex2D(_Normal3, IN.tc_Splat23.zw));
fixed3 nrm4 = UnpackNormal(tex2D(_Normal4, IN.tc_Splat23.zw));
nrm0 = splat_control.r * MTE_NormalIntensity_fixed(nrm0, _NormalIntensity0);
nrm1 = splat_control.g * MTE_NormalIntensity_fixed(nrm1, _NormalIntensity1);
nrm2 = splat_control.b * MTE_NormalIntensity_fixed(nrm2, _NormalIntensity2);
nrm3 = splat_control.a * MTE_NormalIntensity_fixed(nrm3, _NormalIntensity3);
nrm4 = splat_control_extra.r * MTE_NormalIntensity_fixed(nrm4, _NormalIntensity4);
mixedNormal = normalize(nrm0 + nrm1 + nrm2 + nrm3 + nrm4);
#else
fixed4 nrm = 0.0f;
nrm += splat_control.r * tex2D(_Normal0, IN.tc_Splat01.xy);
nrm += splat_control.g * tex2D(_Normal1, IN.tc_Splat01.zw);
nrm += splat_control.b * tex2D(_Normal2, IN.tc_Splat23.xy);
nrm += splat_control.a * tex2D(_Normal3, IN.tc_Splat23.zw);
nrm += splat_control_extra.r * tex2D(_Normal4, IN.tc_Splat23.zw);
mixedNormal = UnpackNormal(nrm);
#endif
}
void surf(Input IN, inout SurfaceOutput o)
{
fixed4 mixedDiffuse;
half weight;
MTE_SplatmapMix(IN, weight, mixedDiffuse, o.Normal);
o.Albedo = mixedDiffuse.rgb;
o.Alpha = weight;
o.Gloss = mixedDiffuse.a;
o.Specular = _Shininess;
}
ENDCG
Category
{
Tags
{
"Queue" = "Geometry-99"
"RenderType" = "Opaque"
}
SubShader//for target 3.0+
{
CGPROGRAM
#pragma target 3.0
ENDCG
}
}
Fallback "MTE/Surface/5 Textures/Bumped/Fog"
CustomEditor "MTE.MTEShaderGUI"
}
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/5Textures/Specular-Fog.shader/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/5Textures/Specular-Fog.shader",
"repo_id": "jynew",
"token_count": 2404
}
| 1,014 |
fileFormatVersion: 2
guid: 84372e3c3b7c0a44e9facf2c1ade9829
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/6Textures/Specular.shader.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/6Textures/Specular.shader.meta",
"repo_id": "jynew",
"token_count": 82
}
| 1,015 |
// alpha-cutout billboard shader
Shader "MTE/Grass/AlphaCutout"
{
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
_MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
_Cutoff("Alpha cutoff", Range(0,1)) = 0.5
}
CGINCLUDE
#pragma surface surf Lambert alphatest:_Cutoff
sampler2D _MainTex;
fixed4 _Color;
struct Input
{
float2 uv_MainTex;
};
void surf(Input IN, inout SurfaceOutput o)
{
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
Category
{
Tags
{
"Queue" = "AlphaTest"
"IgnoreProjector" = "True"
"RenderType" = "TransparentCutout"
}
LOD 100
SubShader//for target 3.0+
{
CGPROGRAM
#pragma target 3.0
ENDCG
}
SubShader//for target 2.5
{
CGPROGRAM
#pragma target 2.5
ENDCG
}
SubShader//for target 2.0
{
CGPROGRAM
#pragma target 2.0
ENDCG
}
}
Fallback "Legacy Shaders/Transparent/Cutout/VertexLit"
}
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/Grass/AlphaCutout.shader/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/Grass/AlphaCutout.shader",
"repo_id": "jynew",
"token_count": 635
}
| 1,016 |
Shader "MTE/VertexColored/ColorOnly"
{
Properties
{
}
CGINCLUDE
#pragma surface surf Lambert vertex:vert finalcolor:MTE_SplatmapFinalColor finalprepass:MTE_SplatmapFinalPrepass finalgbuffer:MTE_SplatmapFinalGBuffer
#pragma multi_compile_fog
struct Input
{
float3 color: COLOR;
UNITY_FOG_COORDS(0)
};
#include "../../MTECommon.hlsl"
void vert(inout appdata_full v, out Input data)
{
UNITY_INITIALIZE_OUTPUT(Input, data);
float4 pos = UnityObjectToClipPos(v.vertex);
UNITY_TRANSFER_FOG(data, pos);
}
void surf (Input IN, inout SurfaceOutput o)
{
o.Albedo = IN.color.rgb;
o.Alpha = 1.0;
}
ENDCG
Category
{
Tags
{
"Queue" = "Geometry-99"
"RenderType" = "Opaque"
}
SubShader//for target 3.0+
{
CGPROGRAM
#pragma target 3.0
ENDCG
}
SubShader//for target 2.5
{
CGPROGRAM
#pragma target 2.5
ENDCG
}
SubShader//for target 2.0
{
CGPROGRAM
#pragma target 2.0
ENDCG
}
}
FallBack "Diffuse"
}
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/Vertex-colored/ColorOnly.shader/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/Builtin/Surface/Vertex-colored/ColorOnly.shader",
"repo_id": "jynew",
"token_count": 502
}
| 1,017 |
fileFormatVersion: 2
guid: fa510ed2a5a3b2d4a9ef902d0fbdd6e2
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/MTECommonPBR.hlsl.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/MeshTerrainEditor/Shaders/MTECommonPBR.hlsl.meta",
"repo_id": "jynew",
"token_count": 84
}
| 1,018 |
using UnityEngine;
using UnityEngine.AI;
namespace UnityEditor.AI
{
[CanEditMultipleObjects]
[CustomEditor(typeof(NavMeshLink))]
class NavMeshLinkEditor : Editor
{
SerializedProperty m_AgentTypeID;
SerializedProperty m_Area;
SerializedProperty m_CostModifier;
SerializedProperty m_AutoUpdatePosition;
SerializedProperty m_Bidirectional;
SerializedProperty m_EndPoint;
SerializedProperty m_StartPoint;
SerializedProperty m_Width;
static int s_SelectedID;
static int s_SelectedPoint = -1;
static Color s_HandleColor = new Color(255f, 167f, 39f, 210f) / 255;
static Color s_HandleColorDisabled = new Color(255f * 0.75f, 167f * 0.75f, 39f * 0.75f, 100f) / 255;
void OnEnable()
{
m_AgentTypeID = serializedObject.FindProperty("m_AgentTypeID");
m_Area = serializedObject.FindProperty("m_Area");
m_CostModifier = serializedObject.FindProperty("m_CostModifier");
m_AutoUpdatePosition = serializedObject.FindProperty("m_AutoUpdatePosition");
m_Bidirectional = serializedObject.FindProperty("m_Bidirectional");
m_EndPoint = serializedObject.FindProperty("m_EndPoint");
m_StartPoint = serializedObject.FindProperty("m_StartPoint");
m_Width = serializedObject.FindProperty("m_Width");
s_SelectedID = 0;
s_SelectedPoint = -1;
NavMeshVisualizationSettings.showNavigation++;
}
void OnDisable()
{
NavMeshVisualizationSettings.showNavigation--;
}
static Matrix4x4 UnscaledLocalToWorldMatrix(Transform t)
{
return Matrix4x4.TRS(t.position, t.rotation, Vector3.one);
}
void AlignTransformToEndPoints(NavMeshLink navLink)
{
var mat = UnscaledLocalToWorldMatrix(navLink.transform);
var worldStartPt = mat.MultiplyPoint(navLink.startPoint);
var worldEndPt = mat.MultiplyPoint(navLink.endPoint);
var forward = worldEndPt - worldStartPt;
var up = navLink.transform.up;
// Flatten
forward -= Vector3.Dot(up, forward) * up;
var transform = navLink.transform;
transform.rotation = Quaternion.LookRotation(forward, up);
transform.position = (worldEndPt + worldStartPt) * 0.5f;
transform.localScale = Vector3.one;
navLink.startPoint = transform.InverseTransformPoint(worldStartPt);
navLink.endPoint = transform.InverseTransformPoint(worldEndPt);
}
public override void OnInspectorGUI()
{
serializedObject.Update();
NavMeshComponentsGUIUtility.AgentTypePopup("Agent Type", m_AgentTypeID);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_StartPoint);
EditorGUILayout.PropertyField(m_EndPoint);
GUILayout.BeginHorizontal();
GUILayout.Space(EditorGUIUtility.labelWidth);
if (GUILayout.Button("Swap"))
{
foreach (NavMeshLink navLink in targets)
{
var tmp = navLink.startPoint;
navLink.startPoint = navLink.endPoint;
navLink.endPoint = tmp;
}
SceneView.RepaintAll();
}
if (GUILayout.Button("Align Transform"))
{
foreach (NavMeshLink navLink in targets)
{
Undo.RecordObject(navLink.transform, "Align Transform to End Points");
Undo.RecordObject(navLink, "Align Transform to End Points");
AlignTransformToEndPoints(navLink);
}
SceneView.RepaintAll();
}
GUILayout.EndHorizontal();
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_Width);
EditorGUILayout.PropertyField(m_CostModifier);
EditorGUILayout.PropertyField(m_AutoUpdatePosition);
EditorGUILayout.PropertyField(m_Bidirectional);
NavMeshComponentsGUIUtility.AreaPopup("Area Type", m_Area);
serializedObject.ApplyModifiedProperties();
EditorGUILayout.Space();
}
static Vector3 CalcLinkRight(NavMeshLink navLink)
{
var dir = navLink.endPoint - navLink.startPoint;
return (new Vector3(-dir.z, 0.0f, dir.x)).normalized;
}
static void DrawLink(NavMeshLink navLink)
{
var right = CalcLinkRight(navLink);
var rad = navLink.width * 0.5f;
Gizmos.DrawLine(navLink.startPoint - right * rad, navLink.startPoint + right * rad);
Gizmos.DrawLine(navLink.endPoint - right * rad, navLink.endPoint + right * rad);
Gizmos.DrawLine(navLink.startPoint - right * rad, navLink.endPoint - right * rad);
Gizmos.DrawLine(navLink.startPoint + right * rad, navLink.endPoint + right * rad);
}
[DrawGizmo(GizmoType.Selected | GizmoType.Active | GizmoType.Pickable)]
static void RenderBoxGizmo(NavMeshLink navLink, GizmoType gizmoType)
{
if (!EditorApplication.isPlaying)
navLink.UpdateLink();
var color = s_HandleColor;
if (!navLink.enabled)
color = s_HandleColorDisabled;
var oldColor = Gizmos.color;
var oldMatrix = Gizmos.matrix;
Gizmos.matrix = UnscaledLocalToWorldMatrix(navLink.transform);
Gizmos.color = color;
DrawLink(navLink);
Gizmos.matrix = oldMatrix;
Gizmos.color = oldColor;
Gizmos.DrawIcon(navLink.transform.position, "NavMeshLink Icon", true);
}
[DrawGizmo(GizmoType.NotInSelectionHierarchy | GizmoType.Pickable)]
static void RenderBoxGizmoNotSelected(NavMeshLink navLink, GizmoType gizmoType)
{
if (NavMeshVisualizationSettings.showNavigation > 0)
{
var color = s_HandleColor;
if (!navLink.enabled)
color = s_HandleColorDisabled;
var oldColor = Gizmos.color;
var oldMatrix = Gizmos.matrix;
Gizmos.matrix = UnscaledLocalToWorldMatrix(navLink.transform);
Gizmos.color = color;
DrawLink(navLink);
Gizmos.matrix = oldMatrix;
Gizmos.color = oldColor;
}
Gizmos.DrawIcon(navLink.transform.position, "NavMeshLink Icon", true);
}
public void OnSceneGUI()
{
var navLink = (NavMeshLink)target;
if (!navLink.enabled)
return;
var mat = UnscaledLocalToWorldMatrix(navLink.transform);
var startPt = mat.MultiplyPoint(navLink.startPoint);
var endPt = mat.MultiplyPoint(navLink.endPoint);
var midPt = Vector3.Lerp(startPt, endPt, 0.35f);
var startSize = HandleUtility.GetHandleSize(startPt);
var endSize = HandleUtility.GetHandleSize(endPt);
var midSize = HandleUtility.GetHandleSize(midPt);
var zup = Quaternion.FromToRotation(Vector3.forward, Vector3.up);
var right = mat.MultiplyVector(CalcLinkRight(navLink));
var oldColor = Handles.color;
Handles.color = s_HandleColor;
Vector3 pos;
if (navLink.GetInstanceID() == s_SelectedID && s_SelectedPoint == 0)
{
EditorGUI.BeginChangeCheck();
Handles.CubeHandleCap(0, startPt, zup, 0.1f * startSize, Event.current.type);
pos = Handles.PositionHandle(startPt, navLink.transform.rotation);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(navLink, "Move link point");
navLink.startPoint = mat.inverse.MultiplyPoint(pos);
}
}
else
{
if (Handles.Button(startPt, zup, 0.1f * startSize, 0.1f * startSize, Handles.CubeHandleCap))
{
s_SelectedPoint = 0;
s_SelectedID = navLink.GetInstanceID();
}
}
if (navLink.GetInstanceID() == s_SelectedID && s_SelectedPoint == 1)
{
EditorGUI.BeginChangeCheck();
Handles.CubeHandleCap(0, endPt, zup, 0.1f * startSize, Event.current.type);
pos = Handles.PositionHandle(endPt, navLink.transform.rotation);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(navLink, "Move link point");
navLink.endPoint = mat.inverse.MultiplyPoint(pos);
}
}
else
{
if (Handles.Button(endPt, zup, 0.1f * endSize, 0.1f * endSize, Handles.CubeHandleCap))
{
s_SelectedPoint = 1;
s_SelectedID = navLink.GetInstanceID();
}
}
EditorGUI.BeginChangeCheck();
pos = Handles.Slider(midPt + right * navLink.width * 0.5f, right, midSize * 0.03f, Handles.DotHandleCap, 0);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(navLink, "Adjust link width");
navLink.width = Mathf.Max(0.0f, 2.0f * Vector3.Dot(right, (pos - midPt)));
}
EditorGUI.BeginChangeCheck();
pos = Handles.Slider(midPt - right * navLink.width * 0.5f, -right, midSize * 0.03f, Handles.DotHandleCap, 0);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(navLink, "Adjust link width");
navLink.width = Mathf.Max(0.0f, 2.0f * Vector3.Dot(-right, (pos - midPt)));
}
Handles.color = oldColor;
}
[MenuItem("GameObject/AI/NavMesh Link", false, 2002)]
static public void CreateNavMeshLink(MenuCommand menuCommand)
{
var parent = menuCommand.context as GameObject;
GameObject go = NavMeshComponentsGUIUtility.CreateAndSelectGameObject("NavMesh Link", parent);
go.AddComponent<NavMeshLink>();
var view = SceneView.lastActiveSceneView;
if (view != null)
view.MoveToView(go.transform);
}
}
}
|
jynew/jyx2/Assets/3rd/NavMeshComponents/Editor/NavMeshLinkEditor.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/NavMeshComponents/Editor/NavMeshLinkEditor.cs",
"repo_id": "jynew",
"token_count": 5254
}
| 1,019 |
fileFormatVersion: 2
guid: 35e95dc5ff2b64380880dd7ac5922847
timeCreated: 1477924430
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: cc7b9475dbddf4f9088d327d6e10ab77, type: 3}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/NavMeshComponents/Scripts/NavMeshModifierVolume.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/NavMeshComponents/Scripts/NavMeshModifierVolume.cs.meta",
"repo_id": "jynew",
"token_count": 126
}
| 1,020 |
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace ProGrids
{
public class pg_ParameterWindow : EditorWindow
{
public pg_Editor editor;
GUIContent gc_predictiveGrid = new GUIContent("Predictive Grid", "If enabled, the grid will automatically render at the optimal axis based on movement.");
GUIContent gc_snapAsGroup = new GUIContent("Snap as Group", "If enabled, selected objects will keep their relative offsets when moving. If disabled, every object in the selection is snapped to grid independently.");
void OnGUI()
{
GUILayout.Label("Snap Settings", EditorStyles.boldLabel);
float snap = editor.GetSnapIncrement();
EditorGUI.BeginChangeCheck();
snap = EditorGUILayout.FloatField("Snap Value", snap);
if(EditorGUI.EndChangeCheck())
editor.SetSnapIncrement(snap);
EditorGUI.BeginChangeCheck();
int majorLineIncrement = EditorPrefs.GetInt(pg_Constant.MajorLineIncrement, 10);
majorLineIncrement = EditorGUILayout.IntField("Major Line Increment", majorLineIncrement);
majorLineIncrement = majorLineIncrement < 2 ? 2 : majorLineIncrement > 128 ? 128 : majorLineIncrement;
if(EditorGUI.EndChangeCheck())
{
EditorPrefs.SetInt(pg_Constant.MajorLineIncrement, majorLineIncrement);
pg_GridRenderer.majorLineIncrement = majorLineIncrement;
pg_Editor.ForceRepaint();
}
editor.ScaleSnapEnabled = EditorGUILayout.Toggle("Snap On Scale", editor.ScaleSnapEnabled);
SnapUnit _gridUnits = (SnapUnit)(EditorPrefs.HasKey(pg_Constant.GridUnit) ? EditorPrefs.GetInt(pg_Constant.GridUnit) : 0);
bool snapAsGroup = editor.snapAsGroup;
snapAsGroup = EditorGUILayout.Toggle(gc_snapAsGroup, snapAsGroup);
if(snapAsGroup != editor.snapAsGroup)
editor.snapAsGroup = snapAsGroup;
EditorGUI.BeginChangeCheck();
_gridUnits = (SnapUnit)EditorGUILayout.EnumPopup("Grid Units", _gridUnits);
EditorGUI.BeginChangeCheck();
editor.angleValue = EditorGUILayout.Slider("Angle", editor.angleValue, 0f, 180f);
if(EditorGUI.EndChangeCheck())
SceneView.RepaintAll();
if( EditorGUI.EndChangeCheck() )
{
EditorPrefs.SetInt(pg_Constant.GridUnit, (int) _gridUnits);
editor.LoadPreferences();
}
bool tmp = editor.predictiveGrid;
tmp = EditorGUILayout.Toggle(gc_predictiveGrid, tmp);
if( tmp != editor.predictiveGrid )
{
editor.predictiveGrid = tmp;
EditorPrefs.SetBool(pg_Constant.PredictiveGrid, tmp);
}
GUILayout.FlexibleSpace();
if( GUILayout.Button("Done"))
this.Close();
}
}
}
|
jynew/jyx2/Assets/3rd/ProCore/ProGrids/Editor/pg_ParameterWindow.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/ProCore/ProGrids/Editor/pg_ParameterWindow.cs",
"repo_id": "jynew",
"token_count": 910
}
| 1,021 |
fileFormatVersion: 2
guid: 5933bfd39d7a5b843a0ed821f85bca19
timeCreated: 1522619008
licenseType: Store
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/QuickOutline/Readme.txt.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/QuickOutline/Readme.txt.meta",
"repo_id": "jynew",
"token_count": 81
}
| 1,022 |
fileFormatVersion: 2
guid: 3916faa55c6a94248959031ee0ad499f
folderAsset: yes
timeCreated: 1522615614
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/QuickOutline/Samples/Scenes.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/QuickOutline/Samples/Scenes.meta",
"repo_id": "jynew",
"token_count": 81
}
| 1,023 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CheckerMaterial
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 8f170bc12f6c3004ea6357ce9e86d958, type: 3}
m_Scale: {x: 2, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
jynew/jyx2/Assets/3rd/ScreenLogger/Example/Materials/CheckerMaterial.mat/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/ScreenLogger/Example/Materials/CheckerMaterial.mat",
"repo_id": "jynew",
"token_count": 365
}
| 1,024 |
fileFormatVersion: 2
guid: a851d2b288f579b4497912edd5624a63
folderAsset: yes
DefaultImporter:
userData:
|
jynew/jyx2/Assets/3rd/ScreenLogger/Example/Scripts.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/ScreenLogger/Example/Scripts.meta",
"repo_id": "jynew",
"token_count": 44
}
| 1,025 |
fileFormatVersion: 2
guid: e0aeafd6ca709b5449035c42f4e3879e
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/3rd/ScreenLogger/Resources/ScreenLoggerPrefab.prefab.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/ScreenLogger/Resources/ScreenLoggerPrefab.prefab.meta",
"repo_id": "jynew",
"token_count": 42
}
| 1,026 |
fileFormatVersion: 2
guid: 2ca9b7e7a8e65d94c89e42c96968b004
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/UHUDText/Content/Art/Animation/Text.controller.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/UHUDText/Content/Art/Animation/Text.controller.meta",
"repo_id": "jynew",
"token_count": 61
}
| 1,027 |
fileFormatVersion: 2
guid: c20b158d5be224147b7bdcff035be0d0
folderAsset: yes
timeCreated: 1493189497
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/UHUDText/Content/Script/Core/Editor.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/UHUDText/Content/Script/Core/Editor.meta",
"repo_id": "jynew",
"token_count": 75
}
| 1,028 |
fileFormatVersion: 2
guid: b139ec3b7dbffd84f94d4250c51923fb
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/UHUDText/Content/Script/Internal/Utils/bl_UHTUtils.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/UHUDText/Content/Script/Internal/Utils/bl_UHTUtils.cs.meta",
"repo_id": "jynew",
"token_count": 87
}
| 1,029 |
fileFormatVersion: 2
guid: eb1ac2eea8547ee4ea1a524ec7db26f9
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/UHUDText/Example/Model/Materials/MazeLowMan 1.mat.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/UHUDText/Example/Model/Materials/MazeLowMan 1.mat.meta",
"repo_id": "jynew",
"token_count": 59
}
| 1,030 |
fileFormatVersion: 2
guid: a4bb751a694b9704aa9b481862ead0b8
timeCreated: 1493189524
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/UHUDText/Example/Scene/HUDTextDemo/NavMesh.asset.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/UHUDText/Example/Scene/HUDTextDemo/NavMesh.asset.meta",
"repo_id": "jynew",
"token_count": 72
}
| 1,031 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Particle_HUD
m_Shader: {fileID: 203, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 5976a59b496ef1e4a86586328bc96824, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _InvFade: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmisColor: {r: 1, g: 1, b: 1, a: 0}
- _TintColor: {r: 1, g: 1, b: 1, a: 0.5019608}
|
jynew/jyx2/Assets/3rd/UHUDText/Example/UI/Particle_HUD.mat/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/UHUDText/Example/UI/Particle_HUD.mat",
"repo_id": "jynew",
"token_count": 418
}
| 1,032 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ratBody1
m_Shader: {fileID: 4800000, guid: 9c6ece3d5ef8bb84db19471daaf6c788, type: 3}
m_ShaderKeywords: _MK_ALBEDO_MAP _MK_BUMP_MAP _MK_LIGHTMODEL_LAMBERT _MK_LIGHTTYPE_CEL_SHADE_SIMPLE
_MODE_OPAQUE _NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap:
IGNOREPROJECTOR: False
QUEUE: Geometry
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 33c69c72febd7d54ca2fd8de02fa3e75, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DissolveMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DissolveRamp:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: ad5bdaa48cb838f4bb9199c9b0fd497a, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Ramp:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ReflectMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SketchMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TranslucentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlbedoMap: 0
- _AnisoOffset: -0.2
- _Blend0: 1
- _Blend1: 0
- _Brightness: 1
- _BumpScale: 1
- _Contrast: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DetailTint: 0.5
- _DissolveAmount: 0.5
- _DissolveRampSize: 0.25
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _LightCuts: 3
- _LightModel: 1
- _LightSmoothness: 0
- _LightThreshold: 0.458
- _LightType: 1
- _MKEditorShowDetailBehavior: 0
- _MKEditorShowDissolveBehavior: 0
- _MKEditorShowLightBehavior: 1
- _MKEditorShowMainBehavior: 1
- _MKEditorShowOutlineBehavior: 1
- _MKEditorShowReflectionBehavior: 0
- _MKEditorShowRenderBehavior: 1
- _MKEditorShowRimBehavior: 1
- _MKEditorShowShadowBehavior: 1
- _MKEditorShowSketchBehavior: 0
- _MKEditorShowSpecularBehavior: 1
- _MKEditorShowTranslucentBehavior: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Outline: 0.0006
- _OutlineSize: 0.02
- _Parallax: 0.02
- _ReflectIntensity: 0.5
- _ReflectSmoothness: 0
- _RimIntensity: 0
- _RimSize: 1.5
- _RimSmoothness: 0.5
- _Roughness: 1
- _Saturation: 1
- _ShadowIntensity: 1.54
- _Shininess: 0.106
- _SketchScale: 16
- _SketchToneMax: 1
- _SketchToneMin: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SpecularIntensity: 0.129
- _SrcBlend: 1
- _TranslucentIntensity: 0.5
- _TranslucentShininess: 0.275
- _UVSec: 0
- _UseAnisotropicSpecular: 0
- _UseBumpMap: 0
- _UseDissolve: 0
- _UseOutline: 0
- _UseReflection: 0
- _UseRim: 0
- _UseSketch: 0
- _UseTranslucent: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DetailColor: {r: 1, g: 1, b: 1, a: 1}
- _DissolveColor: {r: 1, g: 1, b: 1, a: 0.5}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _HighlightColor: {r: 1, g: 1, b: 1, a: 1}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectColor: {r: 1, g: 1, b: 1, a: 0.5}
- _RimColor: {r: 1, g: 1, b: 1, a: 1}
- _ShadowColor: {r: 0.25, g: 0.25, b: 0.25, a: 0.5}
- _SpecColor: {r: 1, g: 1, b: 1, a: 0.5}
- _TranslucentColor: {r: 1, g: 1, b: 1, a: 0.5}
|
jynew/jyx2/Assets/3rd/_MK/MKToonFree/Demo/Materials/ratBody1.mat/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/_MK/MKToonFree/Demo/Materials/ratBody1.mat",
"repo_id": "jynew",
"token_count": 2761
}
| 1,033 |
//forward add setup
#ifndef MK_TOON_FORWARD_ADD_SETUP
#define MK_TOON_FORWARD_ADD_SETUP
#ifndef MK_TOON_FWD_ADD_PASS
#define MK_TOON_FWD_ADD_PASS 1
#endif
#include "UnityGlobalIllumination.cginc"
#include "UnityCG.cginc"
#include "AutoLight.cginc"
#include "../Common/MKToonV.cginc"
#include "../Common/MKToonInc.cginc"
#include "../Forward/MKToonForwardIO.cginc"
#include "../Surface/MKToonSurfaceIO.cginc"
#include "../Common/MKToonLight.cginc"
#include "../Surface/MKToonSurface.cginc"
#endif
|
jynew/jyx2/Assets/3rd/_MK/MKToonFree/Shader/Inc/Forward/MKToonForwardAddSetup.cginc/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/_MK/MKToonFree/Shader/Inc/Forward/MKToonForwardAddSetup.cginc",
"repo_id": "jynew",
"token_count": 229
}
| 1,034 |
//shadow input and output
#ifndef MK_TOON_SHADOWCASTER_IO
#define MK_TOON_SHADOWCASTER_IO
/////////////////////////////////////////////////////////////////////////////////////////////
// INPUT
/////////////////////////////////////////////////////////////////////////////////////////////
struct VertexInputShadowCaster
{
float4 vertex : POSITION;
//use normals for cubemapped shadows (point lights)
//#ifndef SHADOWS_CUBE
float3 normal : NORMAL;
//#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
/////////////////////////////////////////////////////////////////////////////////////////////
// OUTPUT
/////////////////////////////////////////////////////////////////////////////////////////////
struct VertexOutputShadowCaster
{
//float3 sv : TEXCOORD0;
V2F_SHADOW_CASTER_NOPOS
fixed deb : TEXCOORD7;
};
#ifdef UNITY_STEREO_INSTANCING_ENABLED
struct VertexOutputStereoShadowCaster
{
UNITY_VERTEX_OUTPUT_STEREO
};
#endif
#endif
|
jynew/jyx2/Assets/3rd/_MK/MKToonFree/Shader/Inc/ShadowCaster/MKToonShadowCasterIO.cginc/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/_MK/MKToonFree/Shader/Inc/ShadowCaster/MKToonShadowCasterIO.cginc",
"repo_id": "jynew",
"token_count": 290
}
| 1,035 |
fileFormatVersion: 2
guid: 4020a1dd63b4f044ea0f3c46196db840
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/_MK/MKToonFree/Shader/MKToonFree_GPUI.shader.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/_MK/MKToonFree/Shader/MKToonFree_GPUI.shader.meta",
"repo_id": "jynew",
"token_count": 86
}
| 1,036 |
/*
* 金庸群侠传3D重制版
* https://github.com/jynew/jynew
*
* 这是本开源项目文件头,所有代码均使用MIT协议。
* 但游戏内资源和第三方插件、dll等请仔细阅读LICENSE相关授权协议文档。
*
* 金庸老先生千古!
*
* 本文件作者:东方怂天(EasternDay)
*/
using System;
using i18n.Ext;
using i18n.TranslatorDef;
using UnityEngine;
using UnityEngine.UI;
namespace i18n.TranslateAttacher
{
/// <summary>
/// TextAttacher是关联到Text组件的翻译中介组件
/// Translator对于Text组件的翻译工作只能通过预先在Text组件上添加本组件才能用更小的资源浪费来获得翻译体验
/// </summary>
[RequireComponent(typeof(Text))]
public class TextAttacher : BaseAttacher
{
/// <summary>
/// 与本脚本关联的Text组件
/// 添加此字段的原因在于方便得到组件,用空间换时间
/// </summary>
/// <returns>当前脚本绑定的Text组件</returns>
private Text TextScript => this.gameObject.GetComponent<Text>();
/// <summary>
/// 组件从未激活状态到激活状态则触发
/// </summary>
private void OnEnable()
{
Refresh();
}
public override void Refresh()
{
//刷新翻译内容
TextScript.text = TextScript.text.GetContent(GetToken());
}
public override string GetToken()
{
//返回注释信息
return $"来自于{transform.GetPath()}的{nameof(TextAttacher)}组件";
}
}
}
|
jynew/jyx2/Assets/3rd/i18n/TranslateAttacher/TextAttacher.cs/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/i18n/TranslateAttacher/TextAttacher.cs",
"repo_id": "jynew",
"token_count": 932
}
| 1,037 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 225627996, guid: ffea41b2ef7376143bee608c897e587a, type: 3}
m_Name: Grafiti DSSD
m_EditorClassIdentifier:
material: {fileID: 2100000, guid: 02183fdd76438e34080d440597bc35cf, type: 2}
regions:
- name: graffiti_atlas_B_0
region:
serializedVersion: 2
x: 0.005126953
y: 0.8178711
width: 0.48608398
height: 0.1809082
- name: graffiti_atlas_B_1
region:
serializedVersion: 2
x: 0.5078125
y: 0.9030762
width: 0.10595703
height: 0.08691406
- name: graffiti_atlas_B_6
region:
serializedVersion: 2
x: 0.6430664
y: 0.8808594
width: 0.34814453
height: 0.10449219
- name: graffiti_atlas_B_9
region:
serializedVersion: 2
x: 0.14233398
y: 0.7722168
width: 0.1171875
height: 0.042236328
- name: graffiti_atlas_B_10
region:
serializedVersion: 2
x: 0.2668457
y: 0.7702637
width: 0.13598633
height: 0.04321289
- name: graffiti_atlas_B_13
region:
serializedVersion: 2
x: 0.40844727
y: 0.76953125
width: 0.09423828
height: 0.044189453
- name: graffiti_atlas_B_14
region:
serializedVersion: 2
x: 0.51049805
y: 0.7685547
width: 0.111328125
height: 0.12084961
- name: graffiti_atlas_B_15
region:
serializedVersion: 2
x: 0.6779785
y: 0.7302246
width: 0.09423828
height: 0.09790039
- name: graffiti_atlas_B_18
region:
serializedVersion: 2
x: 0.77246094
y: 0.60717773
width: 0.20605469
height: 0.26293945
- name: graffiti_atlas_B_19
region:
serializedVersion: 2
x: 0.014892578
y: 0.7709961
width: 0.12158203
height: 0.03930664
- name: graffiti_atlas_B_25
region:
serializedVersion: 2
x: 0.0041503906
y: 0.58862305
width: 0.48608398
height: 0.17749023
- name: graffiti_atlas_B_26
region:
serializedVersion: 2
x: 0.49609375
y: 0.58984375
width: 0.17602539
height: 0.17382812
- name: graffiti_atlas_B_27
region:
serializedVersion: 2
x: 0.6862793
y: 0.6015625
width: 0.080566406
height: 0.125
- name: graffiti_atlas_B_28
region:
serializedVersion: 2
x: 0.0063476562
y: 0.453125
width: 0.1953125
height: 0.12646484
- name: graffiti_atlas_B_29
region:
serializedVersion: 2
x: 0.21166992
y: 0.45874023
width: 0.18530273
height: 0.13110352
- name: graffiti_atlas_B_30
region:
serializedVersion: 2
x: 0.41381836
y: 0.4675293
width: 0.27001953
height: 0.1184082
- name: graffiti_atlas_B_32
region:
serializedVersion: 2
x: 0.75683594
y: 0.5061035
width: 0.22827148
height: 0.092285156
- name: graffiti_atlas_B_37
region:
serializedVersion: 2
x: 0.42651367
y: 0.41015625
width: 0.119140625
height: 0.046875
- name: graffiti_atlas_B_38
region:
serializedVersion: 2
x: 0.5683594
y: 0.40893555
width: 0.14941406
height: 0.05419922
- name: graffiti_atlas_B_39
region:
serializedVersion: 2
x: 0.74658203
y: 0.4416504
width: 0.13793945
height: 0.055908203
- name: graffiti_atlas_B_41
region:
serializedVersion: 2
x: 0.90625
y: 0.44873047
width: 0.087402344
height: 0.048095703
- name: graffiti_atlas_B_42
region:
serializedVersion: 2
x: 0.0073242188
y: 0.2783203
width: 0.2680664
height: 0.17211914
- name: graffiti_atlas_B_44
region:
serializedVersion: 2
x: 0.7546387
y: 0.3203125
width: 0.119628906
height: 0.09667969
- name: graffiti_atlas_B_48
region:
serializedVersion: 2
x: 0.28710938
y: 0.31713867
width: 0.3642578
height: 0.087402344
- name: graffiti_atlas_B_49
region:
serializedVersion: 2
x: 0.6706543
y: 0.31713867
width: 0.07373047
height: 0.07543945
- name: graffiti_atlas_B_51
region:
serializedVersion: 2
x: 0.8815918
y: 0.34765625
width: 0.11328125
height: 0.052001953
- name: graffiti_atlas_B_52
region:
serializedVersion: 2
x: 0.30371094
y: 0.1899414
width: 0.4345703
height: 0.118652344
- name: graffiti_atlas_B_54
region:
serializedVersion: 2
x: 0.89746094
y: 0.30322266
width: 0.08227539
height: 0.03857422
- name: graffiti_atlas_B_56
region:
serializedVersion: 2
x: 0.7548828
y: 0.23657227
width: 0.12719727
height: 0.07324219
- name: graffiti_atlas_B_62
region:
serializedVersion: 2
x: 0.89941406
y: 0.23852539
width: 0.087646484
height: 0.052001953
- name: graffiti_atlas_B_71
region:
serializedVersion: 2
x: 0
y: 0.17138672
width: 0.2854004
height: 0.103027344
- name: graffiti_atlas_B_73
region:
serializedVersion: 2
x: 0.7578125
y: 0.20092773
width: 0.12402344
height: 0.03466797
- name: graffiti_atlas_B_74
region:
serializedVersion: 2
x: 0.90185547
y: 0.20141602
width: 0.08496094
height: 0.033935547
- name: graffiti_atlas_B_77
region:
serializedVersion: 2
x: 0.0048828125
y: 0.010498047
width: 0.30908203
height: 0.1652832
- name: graffiti_atlas_B_78
region:
serializedVersion: 2
x: 0.33862305
y: 0.09033203
width: 0.2915039
height: 0.09033203
- name: graffiti_atlas_B_79
region:
serializedVersion: 2
x: 0.6657715
y: 0.048828125
width: 0.31152344
height: 0.1315918
- name: graffiti_atlas_B_80
region:
serializedVersion: 2
x: 0.32617188
y: 0.016601562
width: 0.33032227
height: 0.06298828
- name: graffiti_atlas_B_83
region:
serializedVersion: 2
x: 0.7092285
y: 0.0031738281
width: 0.2758789
height: 0.04296875
- name: graffiti_atlas_B_2
region:
serializedVersion: 2
x: 0.28271484
y: 0.40649414
width: 0.1262207
height: 0.044189453
- name: graffiti_atlas_B_3
region:
serializedVersion: 2
x: 0.6982422
y: 0.4958496
width: 0.047607422
height: 0.04296875
- name: graffiti_atlas_B_4
region:
serializedVersion: 2
x: 0.6911621
y: 0.54345703
width: 0.060791016
height: 0.05126953
- name: graffiti_atlas_B_5
region:
serializedVersion: 2
x: 0.62402344
y: 0.77246094
width: 0.048828125
height: 0.04711914
- name: graffiti_atlas_B_7
region:
serializedVersion: 2
x: 0.6279297
y: 0.8305664
width: 0.13891602
height: 0.049316406
- name: graffiti_atlas_B_8
region:
serializedVersion: 2
x: 0.87646484
y: 0.40161133
width: 0.1081543
height: 0.037841797
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Atlas/Grafiti DSSD.asset/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Atlas/Grafiti DSSD.asset",
"repo_id": "jynew",
"token_count": 3902
}
| 1,038 |
fileFormatVersion: 2
guid: 4416bb07070ea734584d77ffd1f5ad9d
folderAsset: yes
timeCreated: 1474534284
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/External.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/External.meta",
"repo_id": "jynew",
"token_count": 75
}
| 1,039 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: DecalCracks_D
m_Shader: {fileID: 4800000, guid: dfdc3438aa55f2b4cae690d9e87aed28, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 82e8512fbd2b8004f9a08907ea328d8a, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _InvFade: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Material/Cracks/DecalCracks_D.mat/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Material/Cracks/DecalCracks_D.mat",
"repo_id": "jynew",
"token_count": 379
}
| 1,040 |
fileFormatVersion: 2
guid: cce913fd485975e4e8462b6005016993
folderAsset: yes
DefaultImporter:
userData:
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Prefabs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Prefabs.meta",
"repo_id": "jynew",
"token_count": 44
}
| 1,041 |
fileFormatVersion: 2
guid: 954ec60471e8a5d42830b6349c5001c9
NativeFormatImporter:
userData:
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Prefabs/Cracks/Decal Cracks D.prefab.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Prefabs/Cracks/Decal Cracks D.prefab.meta",
"repo_id": "jynew",
"token_count": 42
}
| 1,042 |
fileFormatVersion: 2
guid: 8da0ab2c194b6cd4699b7773a1a08ef1
folderAsset: yes
timeCreated: 1468224227
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Prefabs/Puddles.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Prefabs/Puddles.meta",
"repo_id": "jynew",
"token_count": 77
}
| 1,043 |
fileFormatVersion: 2
guid: c5a03a82ac892b2458169498d6db9220
timeCreated: 1467733023
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Scripts/Editor/DSSDShaderGUI.cs.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Scripts/Editor/DSSDShaderGUI.cs.meta",
"repo_id": "jynew",
"token_count": 101
}
| 1,044 |
// Easy Decal shader using Unity's standard pbs workflow. v1.0
Shader "Easy Decal/ED Standard (Specular, Vertex Alpha, Cutoff)"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_SpecMap ("Specular (RGB) Smoothness (A)", 2D) = "white" {}
_BumpMap ("Normalmap", 2D) = "bump" {}
_Occlusion ("Ambient Occlusion (R)", 2D) = "white" {}
_Specularity ("Specular Multiplier", Range(0,1)) = 1.0
_Smoothness ("Smoothness Multiplier", Range(0,1)) = 1.0
_Cutoff ("Cutoff", Range(0.01,1)) = 0.1
}
SubShader
{
Tags
{
"Queue"="Transparent"
"RenderType"="Transparent"
"ForceNoShadowCasting" = "True"
}
LOD 200
Offset -1,-1
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf StandardSpecular fullforwardshadows alphatest:_Cutoff
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
sampler2D _SpecMap;
sampler2D _BumpMap;
sampler2D _Occlusion;
half _Specularity;
half _Smoothness;
fixed4 _Color;
struct Input
{
float2 uv_MainTex;
float2 uv_BumpMap;
float4 color : COLOR;
};
void surf (Input IN, inout SurfaceOutputStandardSpecular o)
{
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
fixed4 s = tex2D (_SpecMap, IN.uv_MainTex);
fixed4 n = tex2D (_BumpMap, IN.uv_BumpMap);
fixed ao = tex2D (_Occlusion, IN.uv_BumpMap).r;
o.Albedo = c.rgb * IN.color.rgb * _Color;
o.Specular = s.rgb * _Specularity;
o.Smoothness = s.a * _Smoothness;
o.Normal = UnpackNormal (n);
o.Occlusion = ao;
o.Alpha = c.a * IN.color.a;
}
ENDCG
}
FallBack "Transparent"
}
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Shader/EDStandardSpecularVACutoff.shader/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Shader/EDStandardSpecularVACutoff.shader",
"repo_id": "jynew",
"token_count": 767
}
| 1,045 |
fileFormatVersion: 2
guid: cddf7f70cd3ca43418ed88033b5e9337
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
|
jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Shader/Legacy/ED_AlphaSimple_GPUI.shader.meta/0
|
{
"file_path": "jynew/jyx2/Assets/3rd/nu Assets/Easy Decal/Shader/Legacy/ED_AlphaSimple_GPUI.shader.meta",
"repo_id": "jynew",
"token_count": 86
}
| 1,046 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.