Esempio n. 1
0
 public void Start()
 {
     animator      = base.gameObject.GetComponent <Animator>();
     runController = base.gameObject.GetComponent <RunController>();
     if (runController != null)
     {
         runController.OnSteer += OnStickDirectionEvent;
     }
     locomotionStateSetter = base.gameObject.GetComponent <AvatarLocomotionStateSetter>();
     if (locomotionStateSetter != null)
     {
         locomotionStateSetter.ActionButtonInvoked += OnActionButtonClicked;
     }
 }
Esempio n. 2
0
 private void Awake()
 {
     dataEntityCollection   = Service.Get <CPDataEntityCollection>();
     locomotionTracker      = GetComponent <LocomotionTracker>();
     locomotionStateSetter  = GetComponent <AvatarLocomotionStateSetter>();
     playerDataHandle       = GetComponent <AvatarDataHandle>();
     positionTimeline       = new PositionTimeline(MaxQueueTimeMS, WarningQueueTimeMS);
     remoteSnowballLauncher = GetComponent <RemotePenguinSnowballThrower>();
     timer        = new Stopwatch();
     eventChannel = new EventChannel(Service.Get <EventDispatcher>());
     eventChannel.AddListener <PlayerActionServiceEvents.LocomotionActionReceived>(onLocomotionAction);
     locomotionEventBroadcaster = GetComponent <LocomotionEventBroadcaster>();
     locomotionEventBroadcaster.OnControlsLocked   += onControlsLocked;
     locomotionEventBroadcaster.OnControlsUnLocked += onControlsUnLocked;
 }