This file contains hidden or 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 UnityEngine; | |
public static class Bezier | |
{ | |
public static Vector3 Cubic(Vector3 a, Vector3 b, Vector3 c, Vector3 d, float t) { | |
float r = 1f - t, r2 = r * r, t2 = t * t; | |
return (r2 * r) * a + (3f * r2 * t) * b + (3f * r * t2) * c + (t2 * t) * d; | |
} |
This file contains hidden or 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 NPBehave; | |
using System.Collections; | |
public class CoroutineAction : Task | |
{ | |
System.Func<IEnumerator> starter; | |
IEnumerator coro; | |
public CoroutineAction(System.Func<IEnumerator> starter) : base("CoroutineAction") { | |
this.starter = starter; |
This file contains hidden or 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
%YAML 1.2 | |
--- | |
name: Panda BT | |
file_extensions: [BT.txt, BT.lib.txt] | |
scope: source.panda | |
contexts: | |
main: | |
- match: \b(tree|sequence|fallback|parallel|race|random|repeat|while|not|mute)\b | |
scope: keyword.control.panda |
This file contains hidden or 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 Vector3 shakePower = new Vector3(0.03f, 0.03f, 0.03f); | |
public float shakeDuration = 1f; | |
private IEnumerator ShakeRoutine() | |
{ | |
for (var t = 0f; t < shakeDuration; t += Time.unscaledDeltaTime) | |
{ | |
var offset = transform.rotation * Vector3.Scale(Random.onUnitSphere, shakePower); | |
transform.position += offset; |