Ejemplo n.º 1
0
 public override void Setup(BasePlayerCharacterController controller)
 {
     base.Setup(controller);
     shooterController = controller as ShooterPlayerCharacterController;
     controllerCamera  = controller.CacheGameplayCameraControls.CacheCamera;
     shooterController.zoomCrosshairImage.preserveAspect = true;
     shooterController.zoomCrosshairImage.raycastTarget  = false;
 }
Ejemplo n.º 2
0
        public void OnClickUse()
        {
            BasePlayerCharacterController owningCharacterController = BasePlayerCharacterController.Singleton;

            if (owningCharacterController != null)
            {
                owningCharacterController.UseHotkey(indexOfData);
            }
        }
Ejemplo n.º 3
0
 public virtual void Setup(BasePlayerCharacterController controller)
 {
     playerCharacterController = controller;
 }
Ejemplo n.º 4
0
        protected override void EntityOnSetOwnerClient()
        {
            base.EntityOnSetOwnerClient();

            // Setup relates elements
            if (IsOwnerClient)
            {
                if (BasePlayerCharacterController.Singleton == null)
                {
                    if (controllerPrefab != null)
                    {
                        BasePlayerCharacterController controller = Instantiate(controllerPrefab);
                        controller.PlayerCharacterEntity = this;
                    }
                    else if (gameInstance.defaultControllerPrefab != null)
                    {
                        BasePlayerCharacterController controller = Instantiate(gameInstance.defaultControllerPrefab);
                        controller.PlayerCharacterEntity = this;
                    }
                    else
                    {
                        Debug.LogWarning("[BasePlayerCharacterEntity] `controllerPrefab` is empty so it cannot be instantiated");
                    }
                }
                if (gameInstance.owningCharacterObjects != null && gameInstance.owningCharacterObjects.Length > 0)
                {
                    foreach (GameObject obj in gameInstance.owningCharacterObjects)
                    {
                        if (obj == null)
                        {
                            continue;
                        }
                        Instantiate(obj, CacheTransform.position, CacheTransform.rotation, CacheTransform);
                    }
                }
                if (gameInstance.owningCharacterMiniMapObjects != null && gameInstance.owningCharacterMiniMapObjects.Length > 0)
                {
                    foreach (GameObject obj in gameInstance.owningCharacterMiniMapObjects)
                    {
                        if (obj == null)
                        {
                            continue;
                        }
                        Instantiate(obj, MiniMapUITransform.position, MiniMapUITransform.rotation, MiniMapUITransform);
                    }
                }
                if (gameInstance.owningCharacterUI != null)
                {
                    InstantiateUI(gameInstance.owningCharacterUI);
                }
            }
            else
            {
                if (gameInstance.nonOwningCharacterMiniMapObjects != null && gameInstance.nonOwningCharacterMiniMapObjects.Length > 0)
                {
                    foreach (GameObject obj in gameInstance.nonOwningCharacterMiniMapObjects)
                    {
                        if (obj == null)
                        {
                            continue;
                        }
                        Instantiate(obj, MiniMapUITransform.position, MiniMapUITransform.rotation, MiniMapUITransform);
                    }
                }
                if (gameInstance.nonOwningCharacterUI != null)
                {
                    InstantiateUI(gameInstance.nonOwningCharacterUI);
                }
            }
        }