void Start() { if (bc == null) { bc = BattleController.instance; } this.tForm = transform; this.sControl = GetComponent<ShipControlPC>(); if (sControl == null) { this.sControl = GetComponent<EnemyShipControl>(); if (sControl == null) { this.sControl = GetComponent<ShipControlTouch>();//TODO: touch control if (sControl == null) { this.sControl = GetComponent<EnemyBossControl>(); } } } sControl.initialize(this); if (gameObject.tag == "Player") { player = this; this.cropShipPosition = true; tForm.position = BattleController.CropShipPosition(tForm.position, shipSize); } else { this.cropShipPosition = false; } }
void Awake() { if(instance != null) { Destroy(gameObject); } instance = this; BX_MIN = 0f; BY_MIN = 0f; BX_MAX = BattleCamera.sWidth; BY_MAX = BattleCamera.sHeight; goPlayer = Instantiate(playerPrefab) as GameObject; goPlayer.transform.position = new Vector3(BX_MIN, BY_MAX / 2.0f + 0.32f); }