Skip to content

Commit

Permalink
#1 #4 #6 Dog sit animation, puppy AI Animator controller, replicated …
Browse files Browse the repository at this point in the history
…Character into PuppyMovement, ProtoDemoWithPuppy scene, forgot to make these commits atomic
  • Loading branch information
Yisas committed Mar 10, 2017
1 parent 9d7b910 commit 6c1f2eb
Show file tree
Hide file tree
Showing 18 changed files with 15,681 additions and 7 deletions.
287 changes: 287 additions & 0 deletions Assets/Animations/Controllers/Puppy.controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Puppy
serializedVersion: 5
m_AnimatorParameters:
- m_Name: walkingSpeed
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: sitting
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1107961347269505582}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &1101148908050063472
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: sitting
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102147535797271968}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101403899936515504
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 3
m_ConditionEvent: walkingSpeed
m_EventTreshold: 0.01
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102982807091396538}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.1
m_TransitionOffset: 0
m_ExitTime: 0.9
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101544365708553788
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: sitting
m_EventTreshold: 0
- m_ConditionMode: 3
m_ConditionEvent: walkingSpeed
m_EventTreshold: 0.1
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102982807091396538}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.752551
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101587703681107360
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: walkingSpeed
m_EventTreshold: 0.01
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102514908807202100}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.1
m_TransitionOffset: 0
m_ExitTime: 0.9
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101725573141672862
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: sitting
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102147535797271968}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101820454843802084
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: sitting
m_EventTreshold: 0
- m_ConditionMode: 4
m_ConditionEvent: walkingSpeed
m_EventTreshold: 0.1
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102514908807202100}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.752551
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1102147535797271968
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Sitting
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101820454843802084}
- {fileID: 1101544365708553788}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 7400000, guid: 4252be19ba7da6641b096223740949c8, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1102 &1102514908807202100
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101403899936515504}
- {fileID: 1101148908050063472}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 7400000, guid: 8d91f098e3dd6b9468026cbff99453ac, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1102 &1102982807091396538
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Walking
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101587703681107360}
- {fileID: 1101725573141672862}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 1
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 7400000, guid: 291083449191a9542a67f93a30d5f34c, type: 2}
m_Tag:
m_SpeedParameter: walkingSpeed
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1107 &1107961347269505582
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102982807091396538}
m_Position: {x: 312, y: 84, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102514908807202100}
m_Position: {x: 228, y: 288, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102147535797271968}
m_Position: {x: 552, y: 264, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 48, y: 24, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102514908807202100}
8 changes: 8 additions & 0 deletions Assets/Animations/Controllers/Puppy.controller.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: DogSitting
m_Name: DogSit
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
Expand Down Expand Up @@ -1594,7 +1594,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions Assets/Animations/Puppy.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions Assets/PATimeRefactor/Assets/Scripts/PuppyCharacterController.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

[RequireComponent(typeof(UnityEngine.AI.NavMeshAgent))]
[RequireComponent(typeof(Character))]
// @PIERRE: I CHANGED THE NAME OF THIS SCRIPT IF YOU HAVE PROBLEMS YOU CAN PUT IT BACK
[RequireComponent(typeof(PuppyMovement))]
public class PuppyCharacterController : MonoBehaviour {

// Almost the same script as the CloneCharacterController.
Expand All @@ -20,8 +22,8 @@ public class PuppyCharacterController : MonoBehaviour {
// This should be a box collider with its origin on the floor, so that the puppy can reach it
public GameObject m_Home;

public UnityEngine.AI.NavMeshAgent m_Agent { get; private set; }
public Character m_Character { get; private set; }
public NavMeshAgent m_Agent { get; private set; }
public PuppyMovement m_Character { get; private set; }

public Vector3 m_Target { get; private set; }

Expand Down Expand Up @@ -52,7 +54,7 @@ public class PuppyCharacterController : MonoBehaviour {
private void Start()
{
m_Agent = GetComponent<UnityEngine.AI.NavMeshAgent>();
m_Character = GetComponent<Character>();
m_Character = GetComponent<PuppyMovement>();
m_PlayerTimeAttachment = m_Player.GetComponent<PlayerTimeAttachment>();
m_HomePosition = m_Home.GetComponent<Transform>().position;
m_Target = m_HomePosition;
Expand Down
Loading

0 comments on commit 6c1f2eb

Please sign in to comment.