-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGetVector3FromList.cs
More file actions
41 lines (33 loc) · 1.11 KB
/
GetVector3FromList.cs
File metadata and controls
41 lines (33 loc) · 1.11 KB
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
using UnityEngine;
using System.Collections.Generic;
namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables
{
[TaskCategory("Basic/SharedVariable")]
[TaskDescription("Removes a vector3 to a vector3 list at an index.")]
public class GetVector3FromList : Action
{
[RequiredField]
[Tooltip("The SharedVector3List to set")]
public SharedVector3List storedVector3List;
public SharedInt index;
public SharedVector3 thePosition;
private Vector3 singleVector;
public override void OnAwake()
{
// storedVector3List.Value = new List<Vector3>();
}
public override TaskStatus OnUpdate()
{
singleVector = storedVector3List.Value[index.Value];
thePosition.Value = singleVector;
return TaskStatus.Success;
}
public override void OnReset()
{
index = 0;
storedVector3List = null;
thePosition = new Vector3(0, 0, 0);
singleVector = new Vector3(0, 0, 0);
}
}
}