92 lines
2.2 KiB
C#
92 lines
2.2 KiB
C#
//============= Copyright (c) Ludic GmbH, All rights reserved. ==============
|
|
//
|
|
// Purpose: Part of the My Behaviour Tree Controller Code
|
|
//
|
|
//=============================================================================
|
|
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using MyBT;
|
|
using UnityEngine.Video;
|
|
|
|
#if UNITY_EDITOR
|
|
using UnityEditor;
|
|
[CustomEditor(typeof(NamedTransform))]
|
|
public class NamedTransformInspector : ComponentHandlerInspector {
|
|
}
|
|
#endif
|
|
|
|
[System.Serializable]
|
|
public class NamedTransform : ComponentHandler {
|
|
public override string TypeLabel () {
|
|
return "Transform";
|
|
}
|
|
|
|
public override string ContentLabel() {
|
|
UpdateComponent();
|
|
return "";
|
|
}
|
|
|
|
public override void UpdateComponent() {
|
|
base.UpdateComponent();
|
|
}
|
|
|
|
// public override void Start() {
|
|
// }
|
|
|
|
// public override void Run(MyBT.NodeState nodeState) {
|
|
// // whan aborting
|
|
// if (nodeState == NodeState.Aborting) {
|
|
// animation.Stop();
|
|
// return;
|
|
// }
|
|
|
|
// // at start
|
|
// if (nodeState == NodeState.FirstRun) {
|
|
// // reset event trigger
|
|
// animation.Play();
|
|
// }
|
|
|
|
// // during runtime
|
|
// if (nodeState == NodeState.Running) {
|
|
// if (!animation.isPlaying) {
|
|
// Task.SetSucceeded();
|
|
// return;
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// public override void Set(NodeState nodeState, string key, string value) {
|
|
// if (nodeState == NodeState.FirstRun) {
|
|
// if (key == "text") {
|
|
// Task.SetSucceeded();
|
|
// return;
|
|
// }
|
|
// }
|
|
// Task.SetFailed();
|
|
// }
|
|
|
|
// public override void Update() {
|
|
// base.Update();
|
|
// }
|
|
|
|
#region both values setting
|
|
// public override void SetAlpha(float alpha) {
|
|
// if (text != null) {
|
|
// Color col = text.color;
|
|
// col.a = 1 - alpha;
|
|
// text.color = col;
|
|
// }
|
|
// }
|
|
|
|
// public override float GetAlpha() {
|
|
// if (text != null) {
|
|
// return 1-text.color.a;
|
|
// }
|
|
// return 0;
|
|
// }
|
|
#endregion
|
|
}
|