mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
TouchIndex to FingerId for touch positions. New names for playmaker variables. New actions: GetTouchIsoPosition and GetTouchIsoTilePosition
This commit is contained in:
@@ -52,11 +52,14 @@
|
|||||||
<Compile Include="Assets\IsoTools\Examples\Scripts\IsoEchoListener.cs" />
|
<Compile Include="Assets\IsoTools\Examples\Scripts\IsoEchoListener.cs" />
|
||||||
<Compile Include="Assets\IsoTools\Examples\Scripts\PlayerController.cs" />
|
<Compile Include="Assets\IsoTools\Examples\Scripts\PlayerController.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoComponentAction.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoComponentAction.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoConvertIsoToScreen.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoConvertIsometricToScreen.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoConvertScreenToIso.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoConvertScreenToIsometric.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetMode.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetMode.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetPosition.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetPosition.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetSize.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetSize.cs" />
|
||||||
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetTilePosition.cs" />
|
||||||
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetTouchIsoPosition.cs" />
|
||||||
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetTouchIsoTilePosition.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetWorldProps.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetWorldProps.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoResize.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoResize.cs" />
|
||||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetMode.cs" />
|
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetMode.cs" />
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ Prefab:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||||
propertyPath: m_LocalPosition.z
|
propertyPath: m_LocalPosition.z
|
||||||
value: 1.4000001
|
value: 1.3000001
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
@@ -445,8 +445,8 @@ MonoBehaviour:
|
|||||||
- IsoTools.PlayMaker.Actions.IsoGetSize
|
- IsoTools.PlayMaker.Actions.IsoGetSize
|
||||||
- IsoTools.PlayMaker.Actions.IsoGetMode
|
- IsoTools.PlayMaker.Actions.IsoGetMode
|
||||||
- HutongGames.PlayMaker.Actions.Wait
|
- HutongGames.PlayMaker.Actions.Wait
|
||||||
- IsoTools.PlayMaker.Actions.IsoConvertScreenToIso
|
- IsoTools.PlayMaker.Actions.IsoConvertIsometricToScreen
|
||||||
- IsoTools.PlayMaker.Actions.IsoConvertIsoToScreen
|
- IsoTools.PlayMaker.Actions.IsoConvertScreenToIsometric
|
||||||
- PlayMaker.ConditionalExpression.ConditionalExpression
|
- PlayMaker.ConditionalExpression.ConditionalExpression
|
||||||
customNames:
|
customNames:
|
||||||
-
|
-
|
||||||
@@ -597,12 +597,12 @@ MonoBehaviour:
|
|||||||
showInInspector: 0
|
showInInspector: 0
|
||||||
networkSync: 0
|
networkSync: 0
|
||||||
value: 1
|
value: 1
|
||||||
- useVariable: 1
|
- useVariable: 0
|
||||||
name:
|
name:
|
||||||
tooltip:
|
tooltip:
|
||||||
showInInspector: 0
|
showInInspector: 0
|
||||||
networkSync: 0
|
networkSync: 0
|
||||||
value: 1
|
value: 0
|
||||||
fsmIntParams: []
|
fsmIntParams: []
|
||||||
fsmBoolParams:
|
fsmBoolParams:
|
||||||
- useVariable: 1
|
- useVariable: 1
|
||||||
@@ -696,13 +696,13 @@ MonoBehaviour:
|
|||||||
- finishEvent
|
- finishEvent
|
||||||
- realTime
|
- realTime
|
||||||
- gameObject
|
- gameObject
|
||||||
- fromIsometricVector
|
- isometricVector
|
||||||
- toScreenVector
|
- storeScreenVector
|
||||||
- everyFrame
|
- everyFrame
|
||||||
- gameObject
|
- gameObject
|
||||||
- fromScreenVector
|
- screenVector
|
||||||
- specificIsometricZ
|
- specificIsometricZ
|
||||||
- toIsometricVector
|
- storeIsometricVector
|
||||||
- everyFrame
|
- everyFrame
|
||||||
- expression
|
- expression
|
||||||
- isTrueEvent
|
- isTrueEvent
|
||||||
@@ -1108,7 +1108,7 @@ Prefab:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||||
propertyPath: m_LocalPosition.z
|
propertyPath: m_LocalPosition.z
|
||||||
value: 1.3000001
|
value: 1.4000001
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
@@ -1166,7 +1166,7 @@ Prefab:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||||
propertyPath: m_LocalPosition.z
|
propertyPath: m_LocalPosition.z
|
||||||
value: 1.2
|
value: 1.1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
@@ -1325,7 +1325,7 @@ Prefab:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||||
propertyPath: m_LocalPosition.z
|
propertyPath: m_LocalPosition.z
|
||||||
value: 1.1
|
value: 1.2
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
using HutongGames.PlayMaker;
|
|
||||||
|
|
||||||
namespace IsoTools.PlayMaker.Actions {
|
|
||||||
[ActionCategory("IsoTools")]
|
|
||||||
[HutongGames.PlayMaker.Tooltip(
|
|
||||||
"Convert Isometric Vector3 Variable to ScreenSpace Vector2 Variable")]
|
|
||||||
public class IsoConvertScreenToIso : IsoComponentAction<IsoWorld> {
|
|
||||||
[RequiredField]
|
|
||||||
[CheckForComponent(typeof(IsoWorld))]
|
|
||||||
[HutongGames.PlayMaker.Tooltip("The IsoWorld for convertation.")]
|
|
||||||
public FsmOwnerDefault gameObject;
|
|
||||||
|
|
||||||
[RequiredField]
|
|
||||||
[UIHint(UIHint.Variable)]
|
|
||||||
[HutongGames.PlayMaker.Tooltip("The Isometric Vector3 variable to convert to a ScreenSpace Vector2.")]
|
|
||||||
public FsmVector3 fromIsometricVector;
|
|
||||||
|
|
||||||
[RequiredField]
|
|
||||||
[UIHint(UIHint.Variable)]
|
|
||||||
[HutongGames.PlayMaker.Tooltip("Store the result in a ScreenSpace Vector2 variable.")]
|
|
||||||
public FsmVector2 toScreenVector;
|
|
||||||
|
|
||||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
|
||||||
public bool everyFrame;
|
|
||||||
|
|
||||||
public override void Reset() {
|
|
||||||
gameObject = null;
|
|
||||||
fromIsometricVector = null;
|
|
||||||
toScreenVector = null;
|
|
||||||
everyFrame = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnEnter() {
|
|
||||||
DoAction();
|
|
||||||
if ( !everyFrame ) {
|
|
||||||
Finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnUpdate() {
|
|
||||||
DoAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoAction() {
|
|
||||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
|
||||||
if ( UpdateCache(go) ) {
|
|
||||||
toScreenVector.Value =
|
|
||||||
isoWorld.IsoToScreen(fromIsometricVector.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // IsoTools.PlayMaker.Actions
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using HutongGames.PlayMaker;
|
||||||
|
|
||||||
|
namespace IsoTools.PlayMaker.Actions {
|
||||||
|
[ActionCategory("IsoTools")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip(
|
||||||
|
"Convert Isometric Vector3 Variable to ScreenSpace Vector2 Variable")]
|
||||||
|
public class IsoConvertIsometricToScreen : IsoComponentAction<IsoWorld> {
|
||||||
|
[RequiredField]
|
||||||
|
[CheckForComponent(typeof(IsoWorld))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip("The IsoWorld for convertation.")]
|
||||||
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
|
[RequiredField]
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Isometric Vector (In)")]
|
||||||
|
public FsmVector3 isometricVector;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Screen Vector (Out)")]
|
||||||
|
public FsmVector2 storeScreenVector;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Screen X (Out)")]
|
||||||
|
public FsmFloat storeScreenX;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Screen Y (Out)")]
|
||||||
|
public FsmFloat storeScreenY;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||||
|
public bool everyFrame;
|
||||||
|
|
||||||
|
public override void Reset() {
|
||||||
|
gameObject = null;
|
||||||
|
isometricVector = null;
|
||||||
|
storeScreenVector = null;
|
||||||
|
storeScreenX = null;
|
||||||
|
storeScreenY = null;
|
||||||
|
everyFrame = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEnter() {
|
||||||
|
DoAction();
|
||||||
|
if ( !everyFrame ) {
|
||||||
|
Finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnUpdate() {
|
||||||
|
DoAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoAction() {
|
||||||
|
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||||
|
if ( UpdateCache(go) ) {
|
||||||
|
var value = isoWorld.IsoToScreen(isometricVector.Value);
|
||||||
|
storeScreenVector.Value = value;
|
||||||
|
storeScreenX.Value = value.x;
|
||||||
|
storeScreenY.Value = value.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // IsoTools.PlayMaker.Actions
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
using HutongGames.PlayMaker;
|
|
||||||
|
|
||||||
namespace IsoTools.PlayMaker.Actions {
|
|
||||||
[ActionCategory("IsoTools")]
|
|
||||||
[HutongGames.PlayMaker.Tooltip(
|
|
||||||
"Convert ScreenSpace Vector2 Variable to Isometric Vector3 Variable")]
|
|
||||||
public class IsoConvertIsoToScreen : IsoComponentAction<IsoWorld> {
|
|
||||||
[RequiredField]
|
|
||||||
[CheckForComponent(typeof(IsoWorld))]
|
|
||||||
[HutongGames.PlayMaker.Tooltip("The IsoWorld for convertation.")]
|
|
||||||
public FsmOwnerDefault gameObject;
|
|
||||||
|
|
||||||
[RequiredField]
|
|
||||||
[UIHint(UIHint.Variable)]
|
|
||||||
[HutongGames.PlayMaker.Tooltip("The ScreenSpace Vector2 variable to convert to a Isometric Vector3.")]
|
|
||||||
public FsmVector2 fromScreenVector;
|
|
||||||
|
|
||||||
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z.")]
|
|
||||||
public FsmFloat specificIsometricZ;
|
|
||||||
|
|
||||||
[RequiredField]
|
|
||||||
[UIHint(UIHint.Variable)]
|
|
||||||
[HutongGames.PlayMaker.Tooltip("Store the result in a Isometric Vector3 variable.")]
|
|
||||||
public FsmVector3 toIsometricVector;
|
|
||||||
|
|
||||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
|
||||||
public bool everyFrame;
|
|
||||||
|
|
||||||
public override void Reset() {
|
|
||||||
gameObject = null;
|
|
||||||
fromScreenVector = null;
|
|
||||||
specificIsometricZ = 0.0f;
|
|
||||||
toIsometricVector = null;
|
|
||||||
everyFrame = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnEnter() {
|
|
||||||
DoAction();
|
|
||||||
if ( !everyFrame ) {
|
|
||||||
Finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnUpdate() {
|
|
||||||
DoAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoAction() {
|
|
||||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
|
||||||
if ( UpdateCache(go) ) {
|
|
||||||
toIsometricVector.Value = isoWorld.ScreenToIso(
|
|
||||||
fromScreenVector.Value,
|
|
||||||
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // IsoTools.PlayMaker.Actions
|
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using HutongGames.PlayMaker;
|
||||||
|
|
||||||
|
namespace IsoTools.PlayMaker.Actions {
|
||||||
|
[ActionCategory("IsoTools")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip(
|
||||||
|
"Convert ScreenSpace Vector2 Variable to Isometric Vector3 Variable")]
|
||||||
|
public class IsoConvertScreenToIsometric : IsoComponentAction<IsoWorld> {
|
||||||
|
[RequiredField]
|
||||||
|
[CheckForComponent(typeof(IsoWorld))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip("The IsoWorld for convertation.")]
|
||||||
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
|
[RequiredField]
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Screen Vector (In)")]
|
||||||
|
public FsmVector2 screenVector;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
|
||||||
|
public FsmFloat specificIsometricZ;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Isometric Vector (Out)")]
|
||||||
|
public FsmVector3 storeIsometricVector;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Isometric X (Out)")]
|
||||||
|
public FsmFloat storeIsometricX;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Isometric Y (Out)")]
|
||||||
|
public FsmFloat storeIsometricY;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Isometric Z (Out)")]
|
||||||
|
public FsmFloat storeIsometricZ;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||||
|
public bool everyFrame;
|
||||||
|
|
||||||
|
public override void Reset() {
|
||||||
|
gameObject = null;
|
||||||
|
screenVector = null;
|
||||||
|
specificIsometricZ = 0.0f;
|
||||||
|
storeIsometricVector = null;
|
||||||
|
storeIsometricX = null;
|
||||||
|
storeIsometricY = null;
|
||||||
|
storeIsometricZ = null;
|
||||||
|
everyFrame = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEnter() {
|
||||||
|
DoAction();
|
||||||
|
if ( !everyFrame ) {
|
||||||
|
Finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnUpdate() {
|
||||||
|
DoAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoAction() {
|
||||||
|
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||||
|
if ( UpdateCache(go) ) {
|
||||||
|
var value = specificIsometricZ.IsNone
|
||||||
|
? isoWorld.ScreenToIso(screenVector.Value)
|
||||||
|
: isoWorld.ScreenToIso(screenVector.Value, specificIsometricZ.Value);
|
||||||
|
storeIsometricVector.Value = value;
|
||||||
|
storeIsometricX.Value = value.x;
|
||||||
|
storeIsometricY.Value = value.y;
|
||||||
|
storeIsometricZ.Value = value.z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // IsoTools.PlayMaker.Actions
|
||||||
@@ -8,16 +8,18 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
public class IsoGetMode : IsoComponentAction<IsoObject> {
|
public class IsoGetMode : IsoComponentAction<IsoObject> {
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[CheckForComponent(typeof(IsoObject))]
|
[CheckForComponent(typeof(IsoObject))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||||
public FsmOwnerDefault gameObject;
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[ObjectType(typeof(IsoObject.Mode))]
|
[ObjectType(typeof(IsoObject.Mode))]
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmEnum mode;
|
[HutongGames.PlayMaker.Title("Store Mode (Out)")]
|
||||||
|
public FsmEnum storeMode;
|
||||||
|
|
||||||
public override void Reset() {
|
public override void Reset() {
|
||||||
gameObject = null;
|
gameObject = null;
|
||||||
mode = null;
|
storeMode = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEnter() {
|
public override void OnEnter() {
|
||||||
@@ -28,7 +30,7 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
void DoAction() {
|
void DoAction() {
|
||||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||||
if ( UpdateCache(go) ) {
|
if ( UpdateCache(go) ) {
|
||||||
mode.Value = isoObject.mode;
|
storeMode.Value = isoObject.mode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,29 +9,35 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
public class IsoGetPosition : IsoComponentAction<IsoObject> {
|
public class IsoGetPosition : IsoComponentAction<IsoObject> {
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[CheckForComponent(typeof(IsoObject))]
|
[CheckForComponent(typeof(IsoObject))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||||
public FsmOwnerDefault gameObject;
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmVector3 vector;
|
[HutongGames.PlayMaker.Title("Store Position Vector (Out)")]
|
||||||
|
public FsmVector3 storeVector;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmFloat x;
|
[HutongGames.PlayMaker.Title("Store Position X (Out)")]
|
||||||
|
public FsmFloat storeX;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmFloat y;
|
[HutongGames.PlayMaker.Title("Store Position Y (Out)")]
|
||||||
|
public FsmFloat storeY;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmFloat z;
|
[HutongGames.PlayMaker.Title("Store Position Z (Out)")]
|
||||||
|
public FsmFloat storeZ;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||||
public bool everyFrame;
|
public bool everyFrame;
|
||||||
|
|
||||||
public override void Reset() {
|
public override void Reset() {
|
||||||
gameObject = null;
|
gameObject = null;
|
||||||
vector = null;
|
storeVector = null;
|
||||||
x = null;
|
storeX = null;
|
||||||
y = null;
|
storeY = null;
|
||||||
z = null;
|
storeZ = null;
|
||||||
everyFrame = false;
|
everyFrame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEnter() {
|
public override void OnEnter() {
|
||||||
@@ -48,11 +54,11 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
void DoAction() {
|
void DoAction() {
|
||||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||||
if ( UpdateCache(go) ) {
|
if ( UpdateCache(go) ) {
|
||||||
var value = isoObject.position;
|
var value = isoObject.position;
|
||||||
vector.Value = value;
|
storeVector.Value = value;
|
||||||
x.Value = value.x;
|
storeX.Value = value.x;
|
||||||
y.Value = value.y;
|
storeY.Value = value.y;
|
||||||
z.Value = value.z;
|
storeZ.Value = value.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,29 +9,35 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
public class IsoGetSize : IsoComponentAction<IsoObject> {
|
public class IsoGetSize : IsoComponentAction<IsoObject> {
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[CheckForComponent(typeof(IsoObject))]
|
[CheckForComponent(typeof(IsoObject))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||||
public FsmOwnerDefault gameObject;
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmVector3 vector;
|
[HutongGames.PlayMaker.Title("Store Size Vector (Out)")]
|
||||||
|
public FsmVector3 storeVector;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmFloat x;
|
[HutongGames.PlayMaker.Title("Store Size X (Out)")]
|
||||||
|
public FsmFloat storeX;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmFloat y;
|
[HutongGames.PlayMaker.Title("Store Size Y (Out)")]
|
||||||
|
public FsmFloat storeY;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
public FsmFloat z;
|
[HutongGames.PlayMaker.Title("Store Size Z (Out)")]
|
||||||
|
public FsmFloat storeZ;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||||
public bool everyFrame;
|
public bool everyFrame;
|
||||||
|
|
||||||
public override void Reset() {
|
public override void Reset() {
|
||||||
gameObject = null;
|
gameObject = null;
|
||||||
vector = null;
|
storeVector = null;
|
||||||
x = null;
|
storeX = null;
|
||||||
y = null;
|
storeY = null;
|
||||||
z = null;
|
storeZ = null;
|
||||||
everyFrame = false;
|
everyFrame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEnter() {
|
public override void OnEnter() {
|
||||||
@@ -48,11 +54,11 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
void DoAction() {
|
void DoAction() {
|
||||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||||
if ( UpdateCache(go) ) {
|
if ( UpdateCache(go) ) {
|
||||||
var value = isoObject.size;
|
var value = isoObject.size;
|
||||||
vector.Value = value;
|
storeVector.Value = value;
|
||||||
x.Value = value.x;
|
storeX.Value = value.x;
|
||||||
y.Value = value.y;
|
storeY.Value = value.y;
|
||||||
z.Value = value.z;
|
storeZ.Value = value.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
65
Assets/IsoTools/PlayMaker/Actions/IsoGetTilePosition.cs
Normal file
65
Assets/IsoTools/PlayMaker/Actions/IsoGetTilePosition.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using HutongGames.PlayMaker;
|
||||||
|
|
||||||
|
namespace IsoTools.PlayMaker.Actions {
|
||||||
|
[ActionCategory("IsoTools")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip(
|
||||||
|
"Gets the TilePosition of a IsoObject and stores it " +
|
||||||
|
"in a Vector3 Variable or each Axis in a Float Variable")]
|
||||||
|
public class IsoGetTilePosition : IsoComponentAction<IsoObject> {
|
||||||
|
[RequiredField]
|
||||||
|
[CheckForComponent(typeof(IsoObject))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||||
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Tile Position Vector (Out)")]
|
||||||
|
public FsmVector3 storeVector;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Tile Position X (Out)")]
|
||||||
|
public FsmFloat storeX;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Tile Position Y (Out)")]
|
||||||
|
public FsmFloat storeY;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Tile Position Z (Out)")]
|
||||||
|
public FsmFloat storeZ;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||||
|
public bool everyFrame;
|
||||||
|
|
||||||
|
public override void Reset() {
|
||||||
|
gameObject = null;
|
||||||
|
storeVector = null;
|
||||||
|
storeX = null;
|
||||||
|
storeY = null;
|
||||||
|
storeZ = null;
|
||||||
|
everyFrame = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEnter() {
|
||||||
|
DoAction();
|
||||||
|
if ( !everyFrame ) {
|
||||||
|
Finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnUpdate() {
|
||||||
|
DoAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoAction() {
|
||||||
|
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||||
|
if ( UpdateCache(go) ) {
|
||||||
|
var value = isoObject.tilePosition;
|
||||||
|
storeVector.Value = value;
|
||||||
|
storeX.Value = value.x;
|
||||||
|
storeY.Value = value.y;
|
||||||
|
storeZ.Value = value.z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // IsoTools.PlayMaker.Actions
|
||||||
12
Assets/IsoTools/PlayMaker/Actions/IsoGetTilePosition.cs.meta
Normal file
12
Assets/IsoTools/PlayMaker/Actions/IsoGetTilePosition.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a4c5cff4e06894f2aae07daa307c76d9
|
||||||
|
timeCreated: 1450207773
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
83
Assets/IsoTools/PlayMaker/Actions/IsoGetTouchIsoPosition.cs
Normal file
83
Assets/IsoTools/PlayMaker/Actions/IsoGetTouchIsoPosition.cs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using HutongGames.PlayMaker;
|
||||||
|
|
||||||
|
namespace IsoTools.PlayMaker.Actions {
|
||||||
|
[ActionCategory("IsoTools")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip(
|
||||||
|
"Gets a touch isometric position.")]
|
||||||
|
public class IsoGetTouchIsoPosition : IsoComponentAction<IsoWorld> {
|
||||||
|
[RequiredField]
|
||||||
|
[CheckForComponent(typeof(IsoWorld))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||||
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
|
[RequiredField]
|
||||||
|
[HutongGames.PlayMaker.Title("Finger Id (In)")]
|
||||||
|
public FsmInt fingerId;
|
||||||
|
|
||||||
|
[CheckForComponent(typeof(Camera))]
|
||||||
|
[HutongGames.PlayMaker.Title("Camera (In)")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
|
||||||
|
public FsmGameObject camera;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
|
||||||
|
public FsmFloat specificIsometricZ;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Position (Out)")]
|
||||||
|
public FsmVector3 storeVector;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Position X (Out)")]
|
||||||
|
public FsmFloat storeX;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Position Y (Out)")]
|
||||||
|
public FsmFloat storeY;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Position Z (Out)")]
|
||||||
|
public FsmFloat storeZ;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||||
|
public bool everyFrame;
|
||||||
|
|
||||||
|
public override void Reset() {
|
||||||
|
gameObject = null;
|
||||||
|
fingerId = null;
|
||||||
|
camera = null;
|
||||||
|
specificIsometricZ = null;
|
||||||
|
storeVector = null;
|
||||||
|
storeX = null;
|
||||||
|
storeY = null;
|
||||||
|
storeZ = null;
|
||||||
|
everyFrame = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEnter() {
|
||||||
|
DoAction();
|
||||||
|
if ( !everyFrame ) {
|
||||||
|
Finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnUpdate() {
|
||||||
|
DoAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoAction() {
|
||||||
|
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||||
|
if ( UpdateCache(go) ) {
|
||||||
|
var value = isoWorld.TouchIsoPosition(
|
||||||
|
fingerId.Value,
|
||||||
|
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
|
||||||
|
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
|
||||||
|
storeVector.Value = value;
|
||||||
|
storeX.Value = value.x;
|
||||||
|
storeY.Value = value.y;
|
||||||
|
storeZ.Value = value.z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // IsoTools.PlayMaker.Actions
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 88c45e14a4cd040f992be5868786242f
|
||||||
|
timeCreated: 1450196704
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using HutongGames.PlayMaker;
|
||||||
|
|
||||||
|
namespace IsoTools.PlayMaker.Actions {
|
||||||
|
[ActionCategory("IsoTools")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip(
|
||||||
|
"Gets a touch isometric tile position.")]
|
||||||
|
public class IsoGetTouchIsoTilePosition : IsoComponentAction<IsoWorld> {
|
||||||
|
[RequiredField]
|
||||||
|
[CheckForComponent(typeof(IsoWorld))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||||
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
|
[RequiredField]
|
||||||
|
[HutongGames.PlayMaker.Title("Finger Id (In)")]
|
||||||
|
public FsmInt fingerId;
|
||||||
|
|
||||||
|
[CheckForComponent(typeof(Camera))]
|
||||||
|
[HutongGames.PlayMaker.Title("Camera (In)")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
|
||||||
|
public FsmGameObject camera;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
|
||||||
|
public FsmFloat specificIsometricZ;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Tile Position (Out)")]
|
||||||
|
public FsmVector3 storeVector;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Tile Position X (Out)")]
|
||||||
|
public FsmFloat storeX;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Tile Position Y (Out)")]
|
||||||
|
public FsmFloat storeY;
|
||||||
|
|
||||||
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Store Tile Position Z (Out)")]
|
||||||
|
public FsmFloat storeZ;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||||
|
public bool everyFrame;
|
||||||
|
|
||||||
|
public override void Reset() {
|
||||||
|
gameObject = null;
|
||||||
|
fingerId = null;
|
||||||
|
camera = null;
|
||||||
|
specificIsometricZ = null;
|
||||||
|
storeVector = null;
|
||||||
|
storeX = null;
|
||||||
|
storeY = null;
|
||||||
|
storeZ = null;
|
||||||
|
everyFrame = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEnter() {
|
||||||
|
DoAction();
|
||||||
|
if ( !everyFrame ) {
|
||||||
|
Finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnUpdate() {
|
||||||
|
DoAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoAction() {
|
||||||
|
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||||
|
if ( UpdateCache(go) ) {
|
||||||
|
var value = isoWorld.TouchIsoTilePosition(
|
||||||
|
fingerId.Value,
|
||||||
|
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
|
||||||
|
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
|
||||||
|
storeVector.Value = value;
|
||||||
|
storeX.Value = value.x;
|
||||||
|
storeY.Value = value.y;
|
||||||
|
storeZ.Value = value.z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // IsoTools.PlayMaker.Actions
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 91eb63755433a4241b6cdf806e27a493
|
||||||
|
timeCreated: 1450196722
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -8,24 +8,31 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
public class IsoGetWorldProps : IsoComponentAction<IsoWorld> {
|
public class IsoGetWorldProps : IsoComponentAction<IsoWorld> {
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[CheckForComponent(typeof(IsoWorld))]
|
[CheckForComponent(typeof(IsoWorld))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||||
public FsmOwnerDefault gameObject;
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Tile Size (Out)")]
|
||||||
public FsmFloat tileSize;
|
public FsmFloat tileSize;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Tile Ratio (Out)")]
|
||||||
public FsmFloat tileRatio;
|
public FsmFloat tileRatio;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Tile Angle (Out)")]
|
||||||
public FsmFloat tileAngle;
|
public FsmFloat tileAngle;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Tile Height (Out)")]
|
||||||
public FsmFloat tileHeight;
|
public FsmFloat tileHeight;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Step Depth (Out)")]
|
||||||
public FsmFloat stepDepth;
|
public FsmFloat stepDepth;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Start Depth (Out)")]
|
||||||
public FsmFloat startDepth;
|
public FsmFloat startDepth;
|
||||||
|
|
||||||
public bool everyFrame;
|
public bool everyFrame;
|
||||||
|
|||||||
@@ -10,17 +10,24 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
public class IsoResize : IsoComponentAction<IsoObject> {
|
public class IsoResize : IsoComponentAction<IsoObject> {
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[CheckForComponent(typeof(IsoObject))]
|
[CheckForComponent(typeof(IsoObject))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to resize.")]
|
[HutongGames.PlayMaker.Tooltip("The IsoObject to resize.")]
|
||||||
public FsmOwnerDefault gameObject;
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Vector (In)")]
|
||||||
[HutongGames.PlayMaker.Tooltip(
|
[HutongGames.PlayMaker.Tooltip(
|
||||||
"Use a stored resize Vector3, " +
|
"Use a stored resize Vector3, " +
|
||||||
"and/or set individual axis below.")]
|
"and/or set individual axis below.")]
|
||||||
public FsmVector3 vector;
|
public FsmVector3 vector;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("X (In)")]
|
||||||
public FsmFloat x;
|
public FsmFloat x;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Y (In)")]
|
||||||
public FsmFloat y;
|
public FsmFloat y;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Z (In)")]
|
||||||
public FsmFloat z;
|
public FsmFloat z;
|
||||||
|
|
||||||
[HutongGames.PlayMaker.Tooltip("Resize over one second")]
|
[HutongGames.PlayMaker.Tooltip("Resize over one second")]
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
public class IsoSetMode : IsoComponentAction<IsoObject> {
|
public class IsoSetMode : IsoComponentAction<IsoObject> {
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[CheckForComponent(typeof(IsoObject))]
|
[CheckForComponent(typeof(IsoObject))]
|
||||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to mode.")]
|
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||||
public FsmOwnerDefault gameObject;
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[ObjectType(typeof(IsoObject.Mode))]
|
[ObjectType(typeof(IsoObject.Mode))]
|
||||||
|
[HutongGames.PlayMaker.Title("Mode (In)")]
|
||||||
public FsmEnum mode;
|
public FsmEnum mode;
|
||||||
|
|
||||||
public override void Reset() {
|
public override void Reset() {
|
||||||
|
|||||||
@@ -8,14 +8,25 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
public class IsoSetWorldProps : IsoComponentAction<IsoWorld> {
|
public class IsoSetWorldProps : IsoComponentAction<IsoWorld> {
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[CheckForComponent(typeof(IsoWorld))]
|
[CheckForComponent(typeof(IsoWorld))]
|
||||||
[HutongGames.PlayMaker.Tooltip("The IsoWorld to props.")]
|
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||||
public FsmOwnerDefault gameObject;
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Tile Size (In)")]
|
||||||
public FsmFloat tileSize;
|
public FsmFloat tileSize;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Tile Ratio (In)")]
|
||||||
public FsmFloat tileRatio;
|
public FsmFloat tileRatio;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Tile Angle (In)")]
|
||||||
public FsmFloat tileAngle;
|
public FsmFloat tileAngle;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Tile Height (In)")]
|
||||||
public FsmFloat tileHeight;
|
public FsmFloat tileHeight;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Step Depth (In)")]
|
||||||
public FsmFloat stepDepth;
|
public FsmFloat stepDepth;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Start Depth (In)")]
|
||||||
public FsmFloat startDepth;
|
public FsmFloat startDepth;
|
||||||
|
|
||||||
public override void Reset() {
|
public override void Reset() {
|
||||||
|
|||||||
@@ -10,17 +10,24 @@ namespace IsoTools.PlayMaker.Actions {
|
|||||||
public class IsoTranslate : IsoComponentAction<IsoObject> {
|
public class IsoTranslate : IsoComponentAction<IsoObject> {
|
||||||
[RequiredField]
|
[RequiredField]
|
||||||
[CheckForComponent(typeof(IsoObject))]
|
[CheckForComponent(typeof(IsoObject))]
|
||||||
|
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to translate.")]
|
[HutongGames.PlayMaker.Tooltip("The IsoObject to translate.")]
|
||||||
public FsmOwnerDefault gameObject;
|
public FsmOwnerDefault gameObject;
|
||||||
|
|
||||||
[UIHint(UIHint.Variable)]
|
[UIHint(UIHint.Variable)]
|
||||||
|
[HutongGames.PlayMaker.Title("Vector (In)")]
|
||||||
[HutongGames.PlayMaker.Tooltip(
|
[HutongGames.PlayMaker.Tooltip(
|
||||||
"Use a stored translation Vector3, " +
|
"Use a stored translation Vector3, " +
|
||||||
"and/or set individual axis below.")]
|
"and/or set individual axis below.")]
|
||||||
public FsmVector3 vector;
|
public FsmVector3 vector;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("X (In)")]
|
||||||
public FsmFloat x;
|
public FsmFloat x;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Y (In)")]
|
||||||
public FsmFloat y;
|
public FsmFloat y;
|
||||||
|
|
||||||
|
[HutongGames.PlayMaker.Title("Z (In)")]
|
||||||
public FsmFloat z;
|
public FsmFloat z;
|
||||||
|
|
||||||
[HutongGames.PlayMaker.Tooltip("Translate over one second")]
|
[HutongGames.PlayMaker.Tooltip("Translate over one second")]
|
||||||
|
|||||||
@@ -165,34 +165,37 @@ namespace IsoTools {
|
|||||||
//
|
//
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
public Vector3 TouchIsoPosition(int touch_index) {
|
public Vector3 TouchIsoPosition(int finger_id) {
|
||||||
return TouchIsoPosition(touch_index, 0.0f);
|
return TouchIsoPosition(finger_id, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 TouchIsoPosition(int touch_index, float iso_z) {
|
public Vector3 TouchIsoPosition(int finger_id, float iso_z) {
|
||||||
if ( !Camera.main ) {
|
if ( !Camera.main ) {
|
||||||
Debug.LogError("Main camera not found!", this);
|
Debug.LogError("Main camera not found!", this);
|
||||||
return Vector3.zero;
|
return Vector3.zero;
|
||||||
}
|
}
|
||||||
return TouchIsoPosition(touch_index, Camera.main, iso_z);
|
return TouchIsoPosition(finger_id, Camera.main, iso_z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 TouchIsoPosition(int touch_index, Camera camera) {
|
public Vector3 TouchIsoPosition(int finger_id, Camera camera) {
|
||||||
return TouchIsoPosition(touch_index, camera, 0.0f);
|
return TouchIsoPosition(finger_id, camera, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 TouchIsoPosition(int touch_index, Camera camera, float iso_z) {
|
public Vector3 TouchIsoPosition(int finger_id, Camera camera, float iso_z) {
|
||||||
if ( touch_index < 0 || touch_index >= Input.touchCount ) {
|
|
||||||
Debug.LogError("Touch index argument is incorrect!", this);
|
|
||||||
return Vector3.zero;
|
|
||||||
}
|
|
||||||
if ( !camera ) {
|
if ( !camera ) {
|
||||||
Debug.LogError("Camera argument is incorrect!", this);
|
Debug.LogError("Camera argument is incorrect!", this);
|
||||||
return Vector3.zero;
|
return Vector3.zero;
|
||||||
}
|
}
|
||||||
return ScreenToIso(
|
for ( var i = 0; i < Input.touchCount; ++i ) {
|
||||||
camera.ScreenToWorldPoint(Input.GetTouch(touch_index).position),
|
var touch = Input.GetTouch(i);
|
||||||
iso_z);
|
if ( touch.fingerId == finger_id ) {
|
||||||
|
return ScreenToIso(
|
||||||
|
camera.ScreenToWorldPoint(touch.position),
|
||||||
|
iso_z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Debug.LogError("Touch finger id argument is incorrect!", this);
|
||||||
|
return Vector3.zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
@@ -201,20 +204,20 @@ namespace IsoTools {
|
|||||||
//
|
//
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
public Vector3 TouchIsoTilePosition(int touch_index) {
|
public Vector3 TouchIsoTilePosition(int finger_id) {
|
||||||
return IsoUtils.Vec3Floor(TouchIsoPosition(touch_index));
|
return IsoUtils.Vec3Floor(TouchIsoPosition(finger_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 TouchIsoTilePosition(int touch_index, float iso_z) {
|
public Vector3 TouchIsoTilePosition(int finger_id, float iso_z) {
|
||||||
return IsoUtils.Vec3Floor(TouchIsoPosition(touch_index, iso_z));
|
return IsoUtils.Vec3Floor(TouchIsoPosition(finger_id, iso_z));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 TouchIsoTilePosition(int touch_index, Camera camera) {
|
public Vector3 TouchIsoTilePosition(int finger_id, Camera camera) {
|
||||||
return IsoUtils.Vec3Floor(TouchIsoPosition(touch_index, camera));
|
return IsoUtils.Vec3Floor(TouchIsoPosition(finger_id, camera));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 TouchIsoTilePosition(int touch_index, Camera camera, float iso_z) {
|
public Vector3 TouchIsoTilePosition(int finger_id, Camera camera, float iso_z) {
|
||||||
return IsoUtils.Vec3Floor(TouchIsoPosition(touch_index, camera, iso_z));
|
return IsoUtils.Vec3Floor(TouchIsoPosition(finger_id, camera, iso_z));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
<Properties StartupItem="Assembly-CSharp.csproj">
|
<Properties StartupItem="Assembly-CSharp.csproj">
|
||||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
||||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Scripts/IsoWorld.cs">
|
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/PlayMaker/Actions/IsoConvertIsometricToScreen.cs">
|
||||||
<Files>
|
<Files>
|
||||||
<File FileName="Assets/IsoTools/Scripts/IsoWorld.cs" Line="24" Column="24" />
|
<File FileName="Assets/IsoTools/PlayMaker/Actions/IsoConvertIsometricToScreen.cs" Line="10" Column="34" />
|
||||||
<File FileName="Assets/IsoTools/Scripts/IsoUtils.cs" Line="8" Column="2" />
|
|
||||||
<File FileName="Assets/IsoTools/Scripts/IsoObject.cs" Line="278" Column="8" />
|
|
||||||
</Files>
|
</Files>
|
||||||
</MonoDevelop.Ide.Workbench>
|
</MonoDevelop.Ide.Workbench>
|
||||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
|||||||
Reference in New Issue
Block a user