예제 #1
0
        /**
         * <summary>Creates a new instance of the 'Object: Check tag' Action</summary>
         * <param name = "gameObject">The GameObject to query</param>
         * <param name = "tag">The tag to check for</param>
         * <returns>The generated Action</returns>
         */
        public static ActionTagCheck CreateNew(GameObject gameObject, string tag)
        {
            ActionTagCheck newAction = (ActionTagCheck)CreateInstance <ActionTagCheck>();

            newAction.objectToCheck = gameObject;
            newAction.tagsToCheck   = tag;
            return(newAction);
        }
예제 #2
0
        /**
         * <summary>Creates a new instance of the 'Object: Check tag' Action</summary>
         * <param name = "gameObject">The GameObject to query</param>
         * <param name = "tags">An array of tags to check for</param>
         * <returns>The generated Action</returns>
         */
        public static ActionTagCheck CreateNew(GameObject gameObject, string[] tags)
        {
            ActionTagCheck newAction = (ActionTagCheck)CreateInstance <ActionTagCheck>();

            newAction.objectToCheck = gameObject;
            string combined = string.Empty;

            for (int i = 0; i < tags.Length; i++)
            {
                combined += tags[i];
                if (i < (tags.Length - 1))
                {
                    combined += ";";
                }
            }
            newAction.tagsToCheck = combined;
            return(newAction);
        }