Esempio n. 1
0
 void Awake()
 {
     currentHexGrid   = defaultHexGrid;
     player1Camera    = defaultPlayer1Camera;
     player2Camera    = defaultPlayer2Camera;
     cardPanelPlayer1 = defaultCardPanelPlayer1;
     cardPanelPlayer2 = defaultCardPanelPlayer2;
     player2Camera.gameObject.SetActive(false);
     currentCamera              = player1Camera;
     currentPath                = new CharacterPath();
     currentAttackPath          = new CharacterPath();
     characters                 = new List <Character> ();
     attackMode                 = false;
     attackButton               = currentHexGrid.GetComponentInChildren <AttackButton> ();
     currentlySelectedCharacter = null;
     turnNumber                 = 1;
     manaText             = currentHexGrid.transform.Find("Hex Map Editor/Mana Text").GetComponent <Text>();
     maximumMana1         = 1;
     maximumMana2         = 1;
     currentMana1         = maximumMana1;
     currentMana2         = maximumMana2;
     characterObjects [0] = GameResources.wolfCharacter.GetComponent <Character>();
     characterObjects [1] = GameResources.dragonCharacter.GetComponent <Character>();
     cardDeck             = currentHexGrid.GetComponentInChildren <Deck> ();
 }
Esempio n. 2
0
    private void Start()
    {
        Transform camT = Camera.main.transform;
        btn45.onClick.AddListener(() => SetXRotation(camT, 45f));
        btn90.onClick.AddListener(() => SetXRotation(camT, 90f));

        rts = Camera.main.GetComponent<RTS_Camera>();
    }
Esempio n. 3
0
 private void Awake()
 {
     RTS_Camera = GetComponent <RTS_Camera>();
     if (player == null)
     {
         player = FindObjectOfType <Player>();
     }
 }
Esempio n. 4
0
    private void Awake()
    {
        m_playerCamera         = GetComponent <Camera>();
        m_photonView           = GetComponent <PhotonView>();
        m_playerCameraMovement = GetComponent <RTS_Camera>();

        if (!m_photonView.isMine)
        {
            DisablePlayerComponents();
        }
    }
Esempio n. 5
0
    // Start is called before the first frame update
    void Start()
    {
        Vector3 spawnPoint01 = new Vector3(16.0f, 0.4f, 10.3f);
        Vector3 spawnPoint02 = new Vector3(16.9f, 0.4f, 10.3f);
        Vector3 spawnPoint03 = new Vector3(16.0f, 0.4f, 8.8f);
        Vector3 spawnPoint04 = new Vector3(16.9f, 0.4f, 8.8f);

        character01       = Instantiate(characterPrefab, spawnPoint01, Quaternion.identity);
        character02       = Instantiate(characterPrefab2, spawnPoint02, Quaternion.identity);
        character03       = Instantiate(characterPrefab3, spawnPoint03, Quaternion.identity);
        character04       = Instantiate(characterPrefab4, spawnPoint04, Quaternion.identity);
        character01.name  = "Player 1";
        character02.name  = "Player 2";
        character03.name  = "Player 3";
        character04.name  = "Player 4";
        selectedCharacter = character01;
        characterAgent    = character01.GetComponent <CharacterAgent>();
        rtscamera         = Camera.main.GetComponent <RTS_Camera>();
    }
Esempio n. 6
0
    public static void PlayerTurn()
    {
        turnNumber++;
        if (player1Turn)
        {
            currentCamera.gameObject.SetActive(false);
            currentCamera = player1Camera;
            currentCamera.gameObject.SetActive(true);
            cardPanelPlayer1.SetActive(true);
            cardDeck = cardPanelPlayer1.GetComponent <Deck> ();
            cardPanelPlayer2.SetActive(false);
        }
        else
        {
            currentCamera.gameObject.SetActive(false);
            currentCamera = player2Camera;
            currentCamera.gameObject.SetActive(true);
            cardPanelPlayer1.SetActive(false);
            cardDeck = cardPanelPlayer2.GetComponent <Deck> ();
            cardPanelPlayer2.SetActive(true);
        }
        currentHexGrid.GetComponentInChildren <HexMapEditor>().currentCamera = GameInformation.currentCamera.GetComponent <Camera> ();

        cardDeck.DrawCard();

        //if (player1Turn)
        //maximumMana++;

        currentMana1 = maximumMana1;
        currentMana2 = maximumMana2;

        foreach (Character character in characters)
        {
            character.attacked = false;
            character.moved    = false;
            character.sleeping = false;
        }
    }
 private void Start()
 {
     cam = gameObject.GetComponent<RTS_Camera>();
     camera = gameObject.GetComponent<Camera>();
 }
Esempio n. 8
0
 private void Start()
 {
     cam    = gameObject.GetComponent <RTS_Camera>();
     camera = gameObject.GetComponent <Camera>();
 }
Esempio n. 9
0
 void Awake()
 {
     Instance = this;
 }
Esempio n. 10
0
    public override void OnInspectorGUI()
    {
        GUIStyle gUIStyle = new GUIStyle();

        gUIStyle.fontSize  = 14;
        gUIStyle.fontStyle = FontStyle.Bold;

        GUIStyle ToggleStyle = new GUIStyle();

        ToggleStyle.fontSize  = 12;
        ToggleStyle.fontStyle = FontStyle.Bold;

        string[] barResources = { "Movement", "Rotation", "Height" };

        RTS_Camera script = target as RTS_Camera;

        select = GUILayout.Toolbar(select, barResources);

        switch (select)
        {
        case 0:
            GUILayout.Label("Movement", gUIStyle);
            GUIContent gUIContent = new GUIContent();

            gUIContent.text = "Use Keyboard Input:";

            script.moveKeyboarInput_bool = EditorGUILayout.Toggle(gUIContent, script.moveKeyboarInput_bool);
            script.horizontalAxisName    = EditorGUILayout.TextField("Horizontal Axis Name:", script.horizontalAxisName);
            script.verticalAxisName      = EditorGUILayout.TextField("Vetical Axis Name:", script.verticalAxisName);
            script.keyboardMovementSpeed = EditorGUILayout.FloatField("Keyboard Movement Speed:", script.keyboardMovementSpeed);

            script.edgeInput_bool        = EditorGUILayout.Toggle("Screen edge input:", script.edgeInput_bool);
            script.panningWithMouse_bool = EditorGUILayout.Toggle("Panning with mouse:", script.panningWithMouse_bool);
            script.mouseMovementSpeed    = EditorGUILayout.FloatField("Mouse Movement Speed:", script.mouseMovementSpeed);
            script.limitMovement_bool    = EditorGUILayout.Toggle("Limit movement:", script.limitMovement_bool);
            script.Boundary = EditorGUILayout.Vector3Field("Limit Boundary:", script.Boundary);
            break;

        case 1:
            GUILayout.Label("Rotation:", gUIStyle);

            script.rotationKeyboardInput_bool = EditorGUILayout.Toggle("Keyboard input:", script.rotationKeyboardInput_bool);
            script.RotateLeft  = (KeyCode)EditorGUILayout.EnumPopup("Rotate Left", script.RotateLeft);
            script.RotateRight = (KeyCode)EditorGUILayout.EnumPopup("Rotate Right:", script.RotateRight);
            script.RotateUp    = (KeyCode)EditorGUILayout.EnumPopup("Rotate Up", script.RotateUp);
            script.RotateDown  = (KeyCode)EditorGUILayout.EnumPopup("Rotate Down", script.RotateDown);

            script.KeyboardRotateSensity = EditorGUILayout.FloatField("Keyboard Rotate Sensity:", script.KeyboardRotateSensity);

            script.rotationMouseInput_bool = EditorGUILayout.Toggle("Mouse input:", script.rotationMouseInput_bool);

            script.rotateXAxisName = EditorGUILayout.TextField("Rotate XAxis Name:", script.rotateXAxisName);
            script.rotateYAxisName = EditorGUILayout.TextField("Rotate YAxis Name:", script.rotateYAxisName);


            script.MouseRotateSensity = EditorGUILayout.FloatField("Mouse Rotate Sensity:", script.MouseRotateSensity);

            break;

        case 2:
            GUILayout.Label("Height:", gUIStyle);

            //script.autoHeight = EditorGUILayout.Toggle("Auto Height:", script.autoHeight);
            //script.heightDampening = EditorGUILayout.FloatField("Height dampening:", script.heightDampening);
            //script.groundMask = EditorGUILayout.LayerField("Ground Mask:", script.groundMask);

            script.Groundmask = (RTS_Camera.MaskLayer)EditorGUILayout.EnumFlagsField("Ground Mask", script.Groundmask);

            script.keyBoardZooming_bool = EditorGUILayout.Toggle("Keyboard zooming:", script.keyBoardZooming_bool);
            script.ZoomIn  = (KeyCode)EditorGUILayout.EnumPopup("Zoom In:", script.ZoomIn);
            script.ZoomOut = (KeyCode)EditorGUILayout.EnumPopup("Zoom Out:", script.ZoomOut);

            script.keyBoardSensity = EditorGUILayout.FloatField("KeyBoard Sensity:", script.keyBoardSensity);

            script.scrollwheelZooming_bool = EditorGUILayout.Toggle("Scrollwheel zooming:", script.scrollwheelZooming_bool);
            script.scrollwheelSensity      = EditorGUILayout.FloatField("scrollwheelSensity:", script.scrollwheelSensity);
            GUILayout.BeginHorizontal();
            script.maxHeight = EditorGUILayout.FloatField("max Height:", script.maxHeight);
            script.minHeight = EditorGUILayout.FloatField("min Height:", script.minHeight);
            GUILayout.EndHorizontal();
            break;
        }
    }
Esempio n. 11
0
 private void Start()
 {
     cam          = gameObject.GetComponent <RTS_Camera>();
     camera       = gameObject.GetComponent <Camera>();
     inputManager = FindObjectOfType <InputManager>();
 }
Esempio n. 12
0
 private void Awake()
 {
     mainCamera = Camera.main;
     rtsCam     = mainCamera.GetComponent <RTS_Camera>();
     zoomMax    = rtsCam.minHeight;
 }
Esempio n. 13
0
 private void Awake()
 {
     mainCamera = Camera.main.GetComponent <RTS_Camera>();
 }