Esempio n. 1
0
 private void Awake()
 {
     if (UnityEngine.Object.FindObjectsOfType <BlobShadowRenderer>().Length > 1)
     {
         throw new Exception("A scene should only contain 1 BlobShadowRenderer.");
     }
     SceneRefs.Set(this);
 }
Esempio n. 2
0
        public void Awake()
        {
            SceneRefs.Set(this);
            renderingState = true;
            GameObject gameObject = GameObject.FindGameObjectWithTag("MainCamera");

            mainCamera = gameObject.GetComponent <Camera>();
        }
 private void Awake()
 {
     SceneRefs.Set(this);
     eventChannel = new EventChannel(Service.Get <EventDispatcher>());
     eventChannel.AddListener <PopupEvents.ShowCameraSpacePopup>(onShowPopup);
     popupManagerTransform = base.transform;
     canvas = GetComponent <Canvas>();
     defaultPlaneDistance = canvas.planeDistance;
     defaultOrderInLayer  = canvas.sortingOrder;
     disableCamera();
 }
 private void Awake()
 {
     if (SceneRefs.IsSet <VirtualJoystick>())
     {
         SceneRefs.Remove(SceneRefs.Get <VirtualJoystick>());
     }
     SceneRefs.Set(this);
     joystick     = GetComponent <RectTransform>();
     joystickBase = base.transform.GetChild(0).GetComponent <RectTransform>();
     joystickPad  = base.transform.GetChild(0).GetChild(0).GetComponent <RectTransform>();
     dispatcher   = Service.Get <EventDispatcher>();
 }
Esempio n. 5
0
 public void Awake()
 {
     SceneRefs.Set(this);
     dispatcher = Service.Get <EventDispatcher>();
     mainCamera = Camera.main.transform;
     nodes      = new Transform[3];
     nodes[0]   = GameplayCameraLeaf;
     nodes[1]   = CinematicCameraLeaf;
     nodes[2]   = ChaseCameraLeaf;
     curNode    = CameraContext.Gameplay;
     nextNode   = curNode;
 }
Esempio n. 6
0
 public void Awake()
 {
     SceneRefs.Set(this);
     desiredTransform = new GameObject().transform;
     feeler           = new Vector3[feelerCount];
     feeler[0]        = base.transform.forward;
     feeler[1]        = Vector3.down;
     feeler[2]        = Vector3.up;
     feeler[3]        = Vector3.right;
     feeler[4]        = Vector3.left;
     feeler[5]        = Vector3.back;
     feeler[6]        = (Vector3.right + Vector3.down).normalized;
     feeler[7]        = (Vector3.left + Vector3.down).normalized;
     base.enabled     = false;
 }
Esempio n. 7
0
 internal virtual void Awake()
 {
     SceneRefs.Set(Camera.main);
     SceneRefs.Set(this);
     Set(GetComponent <CameraController>());
     desiredGoal           = base.transform.position;
     constrainedGoal       = base.transform.position;
     lookat                = base.transform.position + base.transform.forward;
     glance                = Quaternion.identity;
     velocityFilterSamples = new List <Vector3>();
     maxMoveSpeed          = -1f;
     maxAimSpeed           = -1f;
     moveBlendState        = default(TransitionBlendState);
     aimBlendState         = default(TransitionBlendState);
     Snap();
 }
 private void setSceneRef()
 {
     if (SceneRefs.IsSet <IScreenContainerStateHandler>())
     {
         IScreenContainerStateHandler screenContainerStateHandler = SceneRefs.Get <IScreenContainerStateHandler>();
         if (!object.ReferenceEquals(screenContainerStateHandler, this))
         {
             SceneRefs.Remove(screenContainerStateHandler);
             SceneRefs.Set((IScreenContainerStateHandler)this);
         }
     }
     else
     {
         SceneRefs.Set((IScreenContainerStateHandler)this);
     }
 }
        private void Awake()
        {
            dataEntityCollection       = Service.Get <CPDataEntityCollection>();
            eventDispatcher            = Service.Get <EventDispatcher>();
            decorationInventoryService = Service.Get <DecorationInventoryService>();
            sceneHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");
            awakeEvents = new EventChannel(eventDispatcher);
            awakeEvents.AddListener <SceneTransitionEvents.LayoutGameObjectsLoaded>(onLayoutGameObjectsLoaded);
            sceneModifiers = new ISceneModifier[1]
            {
                new EditModeModifier(this)
            };
            IGameData gameData = Service.Get <IGameData>();

            decorationDefinitions = gameData.Get <Dictionary <int, DecorationDefinition> >();
            structureDefinitions  = gameData.Get <Dictionary <int, StructureDefinition> >();
            SceneRefs.Set(this);
        }
Esempio n. 10
0
 public void Awake()
 {
     activeSelectionState          = new ActiveSelectionState();
     dragItemInputInteractionState = new DragItemInputInteractionState();
     swipeScreenInputState         = new SwipeScreenInputState();
     noSelectionState = new NoSelectionState();
     activeSelectionState.TouchPhaseEnded               += OnActiveSelectionStateTouchPhaseEnded;
     activeSelectionState.TouchPhaseMoved               += OnActiveSelectionStateTouchPhaseMoved;
     dragItemInputInteractionState.TouchPhaseEnded      += OnDragItemInputInteractionStateTouchPhaseEnded;
     dragItemInputInteractionState.TouchPhaseMoved      += OnDragItemInputInteractionStateTouchPhaseMoved;
     dragItemInputInteractionState.TouchPhaseStationary += OnDragItemInputInteractionStateTouchPhaseStationary;
     noSelectionState.TouchPhaseEnded      += OnNoSelectionStateTouchPhaseEnded;
     noSelectionState.TouchPhaseMoved      += OnNoSelectionStateTouchPhaseMoved;
     swipeScreenInputState.TouchPhaseMoved += OnSwipeScreenInputStateTouchPhaseMoved;
     swipeScreenInputState.TouchPhaseEnded += OnSwipeScreenInputStateTouchPhaseEnded;
     currentState = noSelectionState;
     currentState.EnterState(TargetLayerMask, MinTimeToMoveInput);
     SceneRefs.Set(this);
     decorationInstallationRulesets = Service.Get <IGameData>().Get <Dictionary <string, CollisionRuleSetDefinition> >();
     setupEventListeners();
 }
Esempio n. 11
0
 private void Awake()
 {
     prefabCacheTracker = base.gameObject.AddComponent <PrefabCacheTracker>();
     SceneRefs.Set(prefabCacheTracker);
 }
Esempio n. 12
0
 public void Awake()
 {
     SceneRefs.Set(this);
     desiredTransform = new GameObject().transform;
     feeler           = new Vector3[feelerCount];
     ref Vector3 reference = ref feeler[0];
Esempio n. 13
0
 private void Awake()
 {
     IsReady = false;
     SceneRefs.Set(this);
 }