ActionTool.GPActionUtils.GetGPActionObjectOrCreate C# (CSharp) Method

GetGPActionObjectOrCreate() public static method

Returns the GPActionObject attached to the specified GameObject if any. Otherwise creates it and return the newly created GPActionObject;
public static GetGPActionObjectOrCreate ( GameObject parentObj ) : GameObject
parentObj GameObject
return GameObject
        public static GameObject GetGPActionObjectOrCreate(GameObject parentObj)
        {
            GameObject obj = GetGPActionObject(parentObj);

            if (obj != null)
                return obj;

            return CreateGPActionObject(parentObj);
        }

Usage Example

示例#1
0
 public virtual GameObject GetGPActionObjectOrCreate()
 {
     return(GPActionUtils.GetGPActionObjectOrCreate(this.gameObject));
 }