Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class BattleManager : MonoBehaviour
  6. {
  7.     public GameObject BattleCamera;
  8.     public GameObject PlayerCamera;
  9.     public GameObject Player;
  10.  
  11.     public Transform EnemyPodium;
  12.     public Transform PlayerPodium;
  13.  
  14.     void Start()
  15.     {
  16.         PlayerCamera.SetActive(true); // Player Camera is on; Battle Camera is off.
  17.         BattleCamera.SetActive(false);
  18.     }
  19.  
  20.     public void StartBattle(Enemy enemy)
  21.     {
  22.         InitWait();
  23.         GameObject Player = GameObject.FindWithTag("Player");
  24.         Player.GetComponent<Knight_Controller>().isInCombat = true;
  25.     }
  26.  
  27.     void InitWait()
  28.     {
  29.         StartCoroutine(Wait());
  30.     }
  31.  
  32.     IEnumerator Wait()
  33.     {
  34.         yield return new WaitForSeconds(4);
  35.         BattleControl();
  36.     }
  37.  
  38.     void BattleControl()
  39.     {
  40.         PlayerCamera.SetActive(false); // Reverves the camera states, and makes it unable for the player to move.
  41.         BattleCamera.SetActive(true);
  42.     }
  43. }
  44. [System.Serializable]
  45. public class Stat
  46. {
  47.     public float min;
  48.     public float max;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement