Exemple #1
0
    IEnumerator FadeGame()
    {
        currentLevel = startLevel;
        CancelInvoke();
        SwitchColors();

        SoundsManager.instance.Play(gamestartClip);
        GUIManager.instance.FadeBlack.DOFade(1, 0.3f);

        VehiclAnimator.transform.DOMoveZ(-20, 0, true);
        yield return(new WaitForSeconds(0.3f));

        GUIManager.instance.mainMenuGUI.gameObject.SetActive(false);
        CameraContainer.SetActive(false);
        VehiclAnimator.SetActive(true);
        VehiclAnimator.transform.DOMoveZ(-10, 3.5f, false);

        GUIManager.instance.FadeBlack.DOFade(0, 1.0f);
        yield return(new WaitForSeconds(1f));

        GUIManager.instance.FadeBlack.DOFade(1, 1f);
        yield return(new WaitForSeconds(1f));

        GUIManager.instance.FadeBlack.DOFade(0, 0.1f);
        VehiclAnimator.SetActive(false);
        CameraContainer.SetActive(true);
        SoundsManager.instance.Play(cardropClip);
        StartActualGame();
    }
Exemple #2
0
        public Settings(CameraContainer cam)
        {
            InitializeComponent();
            this.cam = cam;

            Loaded += Settings_Loaded;
        }
Exemple #3
0
        //   TextBoxOutputter outputter;
        public Preview(CameraContainer cam)
        {
            InitializeComponent();

            this.cam = cam;
            //          outputter = new TextBoxOutputter(TestBox);
            //          Console.SetOut(outputter);
            Loaded += Preview_Loaded;
        }
Exemple #4
0
 public Bitmap CaptureImage()
 {
     lock (_locker)
     {
         Bitmap image = null;
         CameraContainer.Invoke((MethodInvoker) delegate
         {
             image = new Bitmap(CameraContainer.Image);
         });
         return(image);
     }
 }
Exemple #5
0
 private void Start()
 {
     if (SceneManager.GetActiveScene().name == "Caveman")
     {
         _camcont = CamContainer.Caveman;
     }
     else if (SceneManager.GetActiveScene().name == "Mystical Forest")
     {
         _camcont = CamContainer.MysticalForest;
     }
     else if (SceneManager.GetActiveScene().name == "SampleScene")
     {
         _camcont = CamContainer.SampleScene;
     }
 }
    ////////////////////////////////////////////////
    ////////////////////////////////////////////////

    void Awake()
    {
        Camera_Pivot = transform.FindDeepChild("CameraPivot").GetComponent <CameraPivot>();
        if (Camera_Pivot == null)
        {
            Debug.LogError("We got a problem here");
        }

        CameraContainer = Camera_Pivot.transform.Find("CameraObject");
        if (CameraContainer == null)
        {
            Debug.LogError("We got a problem here");
        }

        MainCamera = CameraContainer.GetComponent <Camera>();
        if (_camera == null)
        {
            Debug.LogError("We got a problem here");
        }

        _camera.enabled = false;
    }
 public settingsContainer(CameraContainer cam)
 {
     InitializeComponent();
     settingsControls.Content = new Settings(cam);
 }
Exemple #8
0
    void DoSpawn(Vector3 P, Vector3 dir)
    {
        Vector3 vector;

        if (this._spawnOnFloor && PhysicsUtility.GetFloorPoint(P, 20f, 50f, this._floorLayer, out vector))
        {
            P.y = vector.y;
        }
        Vector3    vector2    = P + this._playerEnt.transform.localPosition;
        GameObject gameObject = Object.Instantiate <GameObject>(this._playerCamera, vector2 + this._playerCamera.transform.localPosition, this._playerCamera.transform.localRotation);

        gameObject.transform.localScale = this._playerCamera.transform.localScale;
        gameObject.name = this._playerCamera.name;
        CameraContainer component = gameObject.GetComponent <CameraContainer>();

        component.Init(this._playerCamera);
        Entity entity = Object.Instantiate <Entity>(this._playerEnt, vector2, base.transform.rotation);

        entity.name = this._playerEnt.name;
        if (component != null)
        {
            RoomSwitchable componentInChildren = entity.GetComponentInChildren <RoomSwitchable>();
            if (componentInChildren != null)
            {
                componentInChildren.SetLevelCamera(component);
            }
        }
        if (this._playerGraphics != null)
        {
            GameObject gameObject2 = Object.Instantiate <GameObject>(this._playerGraphics, entity.transform.position + this._playerGraphics.transform.localPosition, this._playerGraphics.transform.localRotation);
            gameObject2.transform.parent     = entity.transform;
            gameObject2.transform.localScale = this._playerGraphics.transform.localScale;
            gameObject2.name = this._playerGraphics.name;
        }
        entity.Init();
        entity.TurnTo(dir, 0f);
        FollowTransform componentInChildren2 = gameObject.GetComponentInChildren <FollowTransform>();

        if (componentInChildren2 != null)
        {
            componentInChildren2.SetTarget(entity.transform);
        }
        LevelCamera componentInChildren3 = gameObject.GetComponentInChildren <LevelCamera>();

        if (componentInChildren3 != null)
        {
            LevelRoom roomForPosition = LevelRoom.GetRoomForPosition(entity.WorldTracePosition, null);
            if (roomForPosition != null)
            {
                componentInChildren3.SetRoom(roomForPosition);
                roomForPosition.SetImportantPoint(vector2);
                LevelRoom.SetCurrentActiveRoom(roomForPosition, false);
            }
        }
        PlayerController controller = ControllerFactory.Instance.GetController <PlayerController>(this._controller);

        controller.ControlEntity(entity);
        controller.name = this._controller.name;
        entity.Activate();
        if (this._varOverrider != null)
        {
            this._varOverrider.Apply(entity);
        }
        EntityHUD componentInChildren4 = gameObject.GetComponentInChildren <EntityHUD>();

        if (componentInChildren4 != null)
        {
            componentInChildren4.Observe(entity, controller);
        }
        EntityObjectAttacher.Attacher attacher   = null;
        EntityObjectAttacher          component2 = base.GetComponent <EntityObjectAttacher>();

        if (component2 != null)
        {
            attacher = component2.GetAttacher();
        }
        EntityObjectAttacher.AttachTag attachTag = null;
        if (attacher != null)
        {
            attachTag = attacher.Attach(entity);
        }
        PlayerRespawner playerRespawner;

        if (this._respawner != null)
        {
            playerRespawner      = Object.Instantiate <PlayerRespawner>(this._respawner);
            playerRespawner.name = this._respawner.name;
        }
        else
        {
            GameObject gameObject3 = new GameObject("PlayerRespawer");
            playerRespawner = gameObject3.AddComponent <PlayerRespawner>();
        }
        playerRespawner.Init(entity, controller, componentInChildren3, componentInChildren2, componentInChildren4, this._gameSaver, attacher, attachTag, this._varOverrider, P, dir);
        VarHelper.PlayerObj = entity.gameObject;         // Store reference to player obj
        PlayerSpawner.OnSpawnedFunc onSpawnedFunc = PlayerSpawner.onSpawned;
        PlayerSpawner.onSpawned = null;
        if (onSpawnedFunc != null)
        {
            onSpawnedFunc(entity, gameObject, controller);
        }
        EventListener.PlayerSpawn(false);         // Invoke custom event
        Object.Destroy(base.gameObject);
    }
Exemple #9
0
 public void MoveToContainer(CameraContainer container, bool animated = true)
 {
     container.AddCamera(this, animated);
 }