// Use this for initialization public Ship() { GameObject prefab = Resources.Load ("OrangeShip") as GameObject; GameObject prefab1 = Resources.Load ("aCamera") as GameObject; aGUI = new ShipGUI(600f, 400f); aShip = Instantiate(prefab); aShip.transform.position = new Vector3 (0, 0, 1); move = new Move (aShip); aCameraObject = new ShipCamera (); }
protected void Awake() { if (FindObjectsOfType <PlayerController>().Length > 1) { Destroy(gameObject); return; } name = "PLAYER CONTROLLER"; cam = Utilities.CheckComponent <Camera>(gameObject); shipCamera = Utilities.CheckComponent <ShipCamera>(gameObject); flycam = Utilities.CheckComponent <Flycam>(gameObject); listener = Utilities.CheckComponent <AudioListener>(gameObject); enabled = false; }
// Start is called before the first frame update void Start() { Instance = this; transform.SetParent(null); }
public void SetActiveCamera(string cameraName) { activeCamera = shipCameras.Find(x => x.ComponentName == cameraName); EmitSignal("CameraChanged"); }
void Awake() { _shipCamera = this.transform.parent.GetComponentInChildren<ShipCamera>(); battleManager = GameObject.Find("BattleManager").GetComponent<BattleManager>(); }