void Awake() { cannon = GameObject.Find("cannon").GetComponent<AudioSource>(); missile = GameObject.Find("rocket").GetComponent<AudioSource>(); choice = PlayerPrefs.GetInt("Select"); if (choice == 1) { defaultTurret = TurretChoice.Tur1; } if (choice == 0) { defaultTurret = TurretChoice.Tur2; } CrosshairTransform = moveCrosshair.Instance().transform; if (!CrosshairTransform) Debug.Log("MOVECROSSHAIR NOT FOUND"); m_Rigidbody = GetComponent<Rigidbody>(); if (BT1 == null) Debug.Log("First Turret Missing"); if (BT2 == null) Debug.Log("Second Turret Missing"); if (BT3 == null) Debug.Log("Third Turret Missing"); m_Speed = Speed; if (BT1 != null) { if (defaultTurret == TurretChoice.Tur1) { audioChoice = 0; activeTurret = BT1; } } if (BT2 != null) { if (defaultTurret == TurretChoice.Tur2) { audioChoice = 1; activeTurret = BT2; } } if (BT3 != null) { if (defaultTurret == TurretChoice.Tur3) activeTurret = BT3; } if (GameObject.Find("BlueCross") == null) Debug.LogError("No Crosshair"); startTankLocation = this.transform; }
public void Sync(SimPlayerSelection other) { celestialBody = other.celestialBody; powerUpToBuy = other.powerUpToBuy; turret = other.turret; turretChoice = other.turretChoice; turretToBuy = other.turretToBuy; turretToPlace = other.turretToPlace; pausedGameChoice = other.pausedGameChoice; newGameChoice = other.newGameChoice; editingState = other.editingState; }
public List<KeyValuePair<string, PanelWidget>> GetHelpBarMessage(TurretChoice choice) { return choice == TurretChoice.Sell ? SellTurretHBMessage : UpgradeTurretHBMessage; }