Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
	/*
 *
 *	Adventure Creator
 *	by Chris Burton, 2013-2014
 *	
 *	"AnimEngine.cs"
 * 
 *	This script is a base class for the Animation engine scripts.
 *  Create a subclass of name "AnimEngine_NewMethodName" and
 * 	add "NewMethodName" to the AnimationEngine enum to integrate
 * 	a new method into the engine.
 * 
 */

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using AC;

#if UNITY_EDITOR
using UnityEditor;
#endif

[System.Serializable]
public class AnimEngine : ScriptableObject
{

	// Character variables
	public AC.Char character;
	public bool turningIsLinear = false;
	public bool rootMotion = false;
	public bool isSpriteBased = false;


	public virtual void Declare (AC.Char _character)
	{
		character = _character;
		turningIsLinear = false;
		rootMotion = false;
		isSpriteBased = false;
	}

	public virtual void CharSettingsGUI ()
	{ 
		#if UNITY_EDITOR
		#endif
	}

	public virtual void ActionCharAnimGUI (ActionCharAnim action)
	{
		#if UNITY_EDITOR
		action.method = (ActionCharAnim.AnimMethodChar) EditorGUILayout.EnumPopup ("Method:", action.method);
		#endif
	}

	public virtual float ActionCharAnimRun (ActionCharAnim action)
	{
		return 0f;
	}

	public virtual void ActionCharHoldGUI (ActionCharHold action)
	{
		#if UNITY_EDITOR
		EditorGUILayout.HelpBox ("This Action is not compatible with this Character's Animation Engine.", MessageType.Info);
		#endif
	}
	
	public virtual void ActionCharHoldRun (ActionCharHold action)
	{ }

	public virtual void ActionSpeechGUI (ActionSpeech action)
	{
		#if UNITY_EDITOR
		#endif
	}
	
	public virtual void ActionSpeechRun (ActionSpeech action)
	{ }

	public virtual void ActionAnimGUI (ActionAnim action)
	{
		#if UNITY_EDITOR
		#endif
	}

	public virtual string ActionAnimLabel (ActionAnim action)
	{
		return "";
	}
	
	public virtual float ActionAnimRun (ActionAnim action)
	{
		return 0f;
	}

	public virtual void ActionCharRenderGUI (ActionCharRender action)
	{ }

	public virtual float ActionCharRenderRun (ActionCharRender action)
	{
		return 0f;
	}

	public virtual void PlayIdle ()
	{ }
	
	public virtual void PlayWalk ()
	{ }

	public virtual void PlayRun ()
	{ }
	
	public virtual void PlayTalk ()
	{ }

	public virtual void PlayTurnLeft ()
	{
		PlayIdle ();
	}
	
	public virtual void PlayTurnRight ()
	{
		PlayIdle ();
	}

}

Commits for Nextrek/SpaceCrew/SpaceCrew/Assets/AdventureCreator/Scripts/Animation/AnimEngine.cs

Diff revisions: vs.
Revision Author Commited Message
83 FMMortaroli picture FMMortaroli Tue 13 May, 2014 11:32:51 +0000