/** * <summary>Creates a new instance of the 'Object: Set parent' Action, set to clear a GameObject's parent</summary> * <param name = "objectToParent">The GameObject to affect</param> * <returns>The generated Action</returns> */ public static ActionParent CreateNew_ClearParent(GameObject objectToClear) { ActionParent newAction = (ActionParent)CreateInstance <ActionParent>(); newAction.parentAction = ParentAction.ClearParent; newAction.obToAffect = objectToClear; return(newAction); }
/** * <summary>Creates a new instance of the 'Object: Set parent' Action, set to parent one GameObject to another</summary> * <param name = "objectToParent">The GameObject to affect</param> * <param name = "newParent">The GameObject's new Transform parent</param> * <returns>The generated Action</returns> */ public static ActionParent CreateNew_SetParent(GameObject objectToParent, Transform newParent) { ActionParent newAction = (ActionParent)CreateInstance <ActionParent>(); newAction.parentAction = ParentAction.SetParent; newAction.obToAffect = objectToParent; newAction.parentTransform = newParent; return(newAction); }