コード例 #1
0
ファイル: ActionCharFace.cs プロジェクト: cvkumar/out-of-body
        /**
         * <summary>Creates a new instance of the 'Character: Face object' Action, set to stop a character's head-turning</summary>
         * <param name = "characterToTurn">The character to affect</param>
         * <param name = "isInstant">If True, the character will stop turning their head instantly</param>
         * <returns>The generated Action</returns>
         */
        public static ActionCharFace CreateNew_HeadStop(AC.Char characterToTurn, bool isInstant = false)
        {
            ActionCharFace newAction = (ActionCharFace)CreateInstance <ActionCharFace>();

            newAction.charToMove  = characterToTurn;
            newAction.faceType    = CharFaceType.Head;
            newAction.stopLooking = true;
            newAction.isInstant   = isInstant;
            return(newAction);
        }
コード例 #2
0
ファイル: ActionCharFace.cs プロジェクト: cvkumar/out-of-body
        /**
         * <summary>Creates a new instance of the 'Character: Face object' Action, set to turn a character's head towards an object</summary>
         * <param name = "characterToTurn">The character to turn</param>
         * <param name = "objectToFace">The GameObject to face</param>
         * <param name = "isInstant">If True, the character will turn instantly</param>
         * <param name = "waitUntilFinish">If True, then the Action will wait until the turn is complete</param>
         * <returns>The generated Action</returns>
         */
        public static ActionCharFace CreateNew_HeadTurn(AC.Char characterToTurn, GameObject objectToFace, bool faceHeadIfCharacter = true, bool isInstant = false, bool waitUntilFinish = false)
        {
            ActionCharFace newAction = (ActionCharFace)CreateInstance <ActionCharFace>();

            newAction.charToMove = characterToTurn;
            newAction.faceType   = CharFaceType.Head;
            newAction.faceObject = objectToFace;
            newAction.lookAtHead = true;
            newAction.isInstant  = isInstant;
            newAction.willWait   = waitUntilFinish;
            return(newAction);
        }
コード例 #3
0
ファイル: ActionCharFace.cs プロジェクト: cvkumar/out-of-body
        /**
         * <summary>Creates a new instance of the 'Character: Face object' Action, set to turn a character's body towards an object</summary>
         * <param name = "characterToTurn">The character to turn</param>
         * <param name = "objectToFace">The GameObject to face</param>
         * <param name = "useObjectRotation">If True, the character will face the same direction as the GameObject, as opposed to facing the GameObject itself</param>
         * <param name = "isInstant">If True, the character will turn instantly</param>
         * <param name = "waitUntilFinish">If True, then the Action will wait until the turn is complete</param>
         * <returns>The generated Action</returns>
         */
        public static ActionCharFace CreateNew_BodyFace(AC.Char characterToTurn, GameObject objectToFace, bool useObjectRotation = false, bool isInstant = false, bool waitUntilFinish = false)
        {
            ActionCharFace newAction = (ActionCharFace)CreateInstance <ActionCharFace>();

            newAction.charToMove   = characterToTurn;
            newAction.faceType     = CharFaceType.Body;
            newAction.faceObject   = objectToFace;
            newAction.copyRotation = useObjectRotation;
            newAction.isInstant    = isInstant;
            newAction.willWait     = waitUntilFinish;
            return(newAction);
        }