private void DoGetFsmVariable() { if (!storeValue.IsNone) { InitFsmVar(); storeValue.GetValueFrom(sourceVariable); storeValue.ApplyValueTo(targetVariable); } }
void DoGetFsmVariable() { if (storeValue.IsNone) { return; } InitFsmVar(); storeValue.GetValueFrom(sourceVariable); storeValue.ApplyValueTo(targetVariable); }
private void DoSetFsmVariable() { setValue.UpdateValue(); if (setValue.IsNone || string.IsNullOrEmpty(variableName.Value)) { return; } var go = Fsm.GetOwnerDefaultTarget(eventTarget.gameObject); if (!go) { return; } if (enable.Value) { go.SetActive(true); if (eventTarget.fsmComponent != null) { eventTarget.fsmComponent.enabled = true; } } string fsmName = eventTarget.fsmName.Value; if (go != cachedGameObject || fsmName != cachedFsmName) { targetFsm = ActionHelpers.GetGameObjectFsm(go, fsmName); if (targetFsm == null) { return; } cachedGameObject = go; cachedFsmName = fsmName; } if (variableName.Value != cachedVariableName) { setValue.UpdateValue(); targetVariable = targetFsm.FsmVariables.FindVariable(setValue.Type, variableName.Value); cachedVariableName = variableName.Value; } if (targetVariable == null) { LogWarning("Missing Variable: " + variableName.Value); return; } setValue.UpdateValue(); setValue.ApplyValueTo(targetVariable); }
private void DoSetFsmVariable() { if (setValue.IsNone || string.IsNullOrEmpty(variableName.Value)) { return; } var go = Fsm.GetOwnerDefaultTarget(gameObject); if (go == null) { return; } if (go != cachedGameObject || fsmName.Value != cachedFsmName) { targetFsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value); if (targetFsm == null) { return; } cachedGameObject = go; cachedFsmName = fsmName.Value; cachedVariableName = string.Empty; // invalidates variable cache } if (variableName.Value != cachedVariableName) { targetVariable = targetFsm.FsmVariables.FindVariable(setValue.Type, variableName.Value); cachedVariableName = variableName.Value; } if (targetVariable == null) { LogWarning("Missing Variable: " + variableName.Value); return; } setValue.UpdateValue(); setValue.ApplyValueTo(targetVariable); }
private void DoSetFsmVariable() { if (setValue.IsNone || string.IsNullOrEmpty(variableName.Value)) { return; } GameObject ownerDefaultTarget = base.Fsm.GetOwnerDefaultTarget(gameObject); if (ownerDefaultTarget == null) { return; } if (ownerDefaultTarget != cachedGameObject || fsmName.Value != cachedFsmName) { targetFsm = ActionHelpers.GetGameObjectFsm(ownerDefaultTarget, fsmName.Value); if (targetFsm == null) { return; } cachedGameObject = ownerDefaultTarget; cachedFsmName = fsmName.Value; } if (variableName.Value != cachedVariableName) { targetVariable = targetFsm.FsmVariables.FindVariable(setValue.Type, variableName.Value); cachedVariableName = variableName.Value; } if (targetVariable == null) { LogWarning("Missing Variable: " + variableName.Value); } else { setValue.ApplyValueTo(targetVariable); } }