This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method | Position | Rotation | Scale | |
---|---|---|---|---|
TransformPoint | ✓ | ✓ | ✓ | |
TransformDirection | x | ✓ | x | |
TransformVector | x | ✓ | ✓ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Render everything except layer 14 | |
camera.cullingMask = ~(1 << 14); | |
// Switch off layer 14, leave others as-is | |
camera.cullingMask &= ~(1 << 14); | |
Switch on layer 14, leave others as-is | |
camera.cullingMask |= (1 << 14); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void StartAsyncOps(ref CancellationTokenSource cancellationTokenSource) | |
{ | |
if (cancellationTokenSource != null) | |
{ | |
cancellationTokenSource.Dispose(); | |
} | |
cancellationTokenSource = new CancellationTokenSource(); | |
} | |
public void StopAsyncOps(CancellationTokenSource cancellationTokenSource) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected float hapticTime; | |
protected virtual void ContinuousHaptic(float limit, HapticPatterns.PresetType presetType = HapticPatterns.PresetType.LightImpact) | |
{ | |
hapticTime += Time.deltaTime; | |
hapticTime = Mathf.Clamp(hapticTime, 0, limit); | |
if (!Mathf.Approximately(hapticTime, limit)) | |
{ | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void WaveAnim(int i,float delay) | |
{ | |
Sequence sequence = DOTween.Sequence(); | |
sequence.Append(transform.DOLocalMoveY(.2f, .3f) | |
.SetEase(Ease.OutFlash) | |
.SetRelative() | |
.SetDelay(i*delay) | |
.SetLoops(2, LoopType.Yoyo)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async UniTask UpdateSibling(int siblingIndex) | |
{ | |
RectTransform.SetSiblingIndex(siblingIndex); | |
await UniTask.Yield(cancellationToken: this.GetCancellationTokenOnDestroy()); | |
LayoutRebuilder.ForceRebuildLayoutImmediate(RectTransform); | |
Canvas.ForceUpdateCanvases(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void PerformHeartBeatEffect(Transform targetTransform) | |
{ | |
Sequence sequence = DOTween.Sequence(); | |
sequence.PrependInterval(3f) | |
.Append(targetTransform.DOPunchScale(.15f * Vector3.one, .5f, 2, 0)) | |
.Append(targetTransform.DOPunchScale(.15f * Vector3.one, .5f, 2, 0)).SetEase(Ease.OutBack).SetLoops(-1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void DoShine(Image bgImage) | |
{ | |
var id = "_ShineLocation"; | |
var bgMat = new Material(bgImage.material); | |
bgImage.material = bgMat; | |
bgMat.SetFloat(id, 0f); | |
_shineSeq?.Kill(); | |
_shineSeq = DOTween.Sequence(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StartSceneWindow : EditorWindow | |
{ | |
private const string ScenePath = "Assets/Core/Scenes/MainScene.unity"; | |
private void OnGUI() | |
{ | |
EditorSceneManager.playModeStartScene = (SceneAsset)EditorGUILayout.ObjectField(new GUIContent("Start Scene"), | |
EditorSceneManager.playModeStartScene, typeof(SceneAsset),false); | |
if (GUILayout.Button("Set as Start Scene")) | |
SetPlayModeStartScene(ScenePath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using Sirenix.OdinInspector; | |
using UnityEditor; | |
using UnityEditor.Presets; | |
using UnityEngine; | |
using UnityEngine.Serialization; | |
namespace PresetEditor |
OlderNewer