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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using HFSM; | |
public class MoveState : StateMachine { | |
protected override void OnUpdate() { | |
Debug.Log("Updating MoveState"); | |
} | |
} |
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
moveState.LoadSubState(runState); | |
moveState.LoadSubState(jumpState); | |
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 void LoadSubState(StateMachine subState) { | |
... | |
} | |
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 class RunState : StateMachine { | |
protected override void OnEnter() { | |
Debug.Log("Enter RunState"); | |
} | |
protected override void OnUpdate() { | |
Debug.Log("Updating RunState"); | |
} | |
protected override void OnExit() { |
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 void AddTransition(StateMachine from, StateMachine to, int trigger) { | |
... | |
} | |
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; | |
using System.Collections.Generic; | |
namespace HFSM { | |
public abstract class StateMachine { | |
private StateMachine currentSubState; | |
private StateMachine defaultSubState; | |
private StateMachine parent; |
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
func (r *renderer) setData(verts []float32, material material) |
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
#version 330 | |
in vec2 fragTexCoord; | |
in vec3 fragNormal; | |
in vec3 fragWorldPos; | |
uniform vec3 color; | |
uniform float specPower; | |
uniform sampler2D cellRampDiffuse; | |
uniform sampler2D cellRampSpecular; |
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
float GetSpaceDistortionLerpValue(float schwarzschildRadius, float distanceToSingularity, float spaceDistortion) { | |
return pow(schwarzschildRadius, spaceDistortion) / pow(distanceToSingularity, spaceDistortion); | |
} |
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
// Created by Johan Svensson. https://medium.com/dotcrossdot | |
// Slightly modified version of http://flafla2.github.io/2016/10/01/raymarching.html | |
// Most shader properties are moved to the material instead for better control. | |
using UnityEngine; | |
using System.Collections; | |
[ExecuteInEditMode] | |
[RequireComponent(typeof(Camera))] | |
[AddComponentMenu("Effects/Raymarch (Generic)")] |
NewerOlder