Example #1
0
 private void Start()
 {
     m_CurrentCamera        = FindObjectOfType <CameraTopDown>();
     m_CurrentCamera.player = prefabPlayer;
     loader = FindObjectOfType <ProgressSceneLoader>();
     loader.DesactiveUI();
     playerLife.health = loader.GetData();
 }
Example #2
0
    public void Listen(IPlotChooserAction action, IAction defaultAction,
                       List <PLOT> excludedPlots = null,
                       float timeToChoose        = DEFAULT_TIME_TO_CHOOSE_PLOT)
    {
        ListeningAction    = action;
        this.defaultAction = defaultAction;
        this.timeToChoose  = timeToChoose;

        // Master initiate the skip count down
        if (PhotonNetwork.IsMasterClient)
        {
            StartTimer();
            SkipButtonUI.GetInstance().ListenClick(new LambdaAction(() =>
            {
                photonView.RPC("OnTimeoutEvent", RpcTarget.All);
            }));
        }
        if (!TurnDirector.Ins.IsMyTurn())
        {
            return;
        }
        // Player choose the plot
        CameraTopDown cameraComponent = CameraTopDown.GetInstance();

        cameraComponent.Active = true;
        cameraComponent.ListenTargetReached(new LambdaAction(() =>
        {
            gameObject.SetActive(true);

            if (excludedPlots != null)
            {
                foreach (PLOT plot in excludedPlots)
                {
                    TileChooserButton.buttonDictionary[plot].button.enabled = false;
                }
            }

            postChosenTile = new LambdaAction(() =>
            {
                cameraComponent.Active = true;
                gameObject.SetActive(false);

                if (excludedPlots != null)
                {
                    foreach (PLOT plot in excludedPlots)
                    {
                        TileChooserButton.buttonDictionary[plot].button.enabled = true;
                    }
                }
            });
        }));
    }
Example #3
0
        void Start()
        {
            // Player movement scripts
            click       = player.GetComponent <ClickToMove>();
            directional = player.GetComponent <DirectionalMove>();
            firstPerson = player.GetComponent <FirstPersonMove>();

            // Camera movement scripts
            topDown    = cam.GetComponent <CameraTopDown>();
            topDownPan = cam.GetComponent <CameraTopDownPan>();
            fps        = cam.GetComponent <CameraFirstPerson>();

            // Set variables for initial camera position and rotation
            camPos = cam.transform.position;
            camRot = cam.transform.rotation;
        }