浏览代码

Fixed Bad drawing of NonNullCheck property drawer / Added ReachPositionRigSetTargetAction

/main
Thomas ICHÉ 4 年前
当前提交
b5fdd993
共有 4 个文件被更改,包括 57 次插入2 次删除
  1. 4
      CHANGELOG.md
  2. 2
      Editor/PropertyDrawers/NonNullCheckPropertyDrawer.cs
  3. 42
      Runtime/LevelScripting/Actions/ReachPositionRigSetTargetAction.cs
  4. 11
      Runtime/LevelScripting/Actions/ReachPositionRigSetTargetAction.cs.meta

4
CHANGELOG.md


- Added Valid/Invalid paths for Platform Logic
- Added Local Space control for ReachPositionRig
- Added "Update SetStateAction" Button in State Machine components to populate the game object with Set State Actions
- Added **Check/Resolve** Window and API : The check window enables performing scriptable checks and resolution actions in your scene for maintenance purposes.
- Added **Check/Resolve** Window and API : The check window enables performing scriptable checks and resolution actions in your scene for maintenance purposes
- Added **ReachPositionRigSetTargetAction**
* Fixed Bad drawing of NonNullCheck property drawer
## 2019.3.5

2
Editor/PropertyDrawers/NonNullCheckPropertyDrawer.cs


bool valid = property.objectReferenceValue != null;
var color = GUI.backgroundColor;
GUI.backgroundColor = valid ? color : Color.red;
EditorGUI.ObjectField(position, property);
EditorGUI.ObjectField(position, property, new GUIContent(ObjectNames.NicifyVariableName(property.name)));
GUI.backgroundColor = color;
}
else

42
Runtime/LevelScripting/Actions/ReachPositionRigSetTargetAction.cs


using GameplayIngredients.Rigs;
using NaughtyAttributes;
using UnityEngine;
namespace GameplayIngredients.Actions
{
public class ReachPositionRigSetTargetAction : ActionBase
{
[NonNullCheck]
public ReachPositionRig reachPositionRig;
[DisableIf("UseInstigatorAsTarget"), NonNullCheck]
public Transform target;
public bool UseInstigatorAsTarget;
public override void Execute(GameObject instigator = null)
{
if (reachPositionRig == null)
{
Debug.LogWarning($"{gameObject.name}: ReachPositionRigSetTarget action could not set target : ReachPositionRig is null");
return;
}
if (UseInstigatorAsTarget)
{
if (instigator != null)
reachPositionRig.SetTarget(instigator.transform);
else
Debug.LogWarning($"{gameObject.name}: ReachPositionRigSetTarget action could not set target : instigator is null");
}
else
{
if (target != null)
reachPositionRig.SetTarget(target);
else
Debug.LogWarning($"{gameObject.name}: ReachPositionRigSetTarget action could not set target : Target is null");
}
}
}
}

11
Runtime/LevelScripting/Actions/ReachPositionRigSetTargetAction.cs.meta


fileFormatVersion: 2
guid: c624e292717b5c6409faa3fc3350cde9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 8957eefd6c14dd24fae1bd3c7fb3309b, type: 3}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存