void Start() { rmData = GetComponent <RadarManager>(); rocketHUD = GameObject.Find("fake weapon hud").GetComponent <Image>();; rocketHUD.gameObject.SetActive(true); SpeedReadout = GameObject.Find("Speed"); throttleReadout = GameObject.Find("Throttle"); if (optionalDangerHeightReadout) { dangerBaseText = optionalDangerHeightReadout.text; } mFlash = GetComponent <MuzzleFlash>(); mFlash.Reset(); StartCoroutine(rocketSalvoRelease()); shootableScript = GetComponent <Shootable>(); wasHealth = startHealth = shootableScript.healthLimit; UI_ThrottleReadout = throttleReadout.GetComponent <UI_Speed> (); UI_SpeedReadout = SpeedReadout.GetComponent <UI_Speed> (); hardpointRef = missionTarget.GetComponentInChildren <HardPointCounter>(); hardpointMax = hardpointRef.hardpointCount; }
private void Awake() { if (instance == null) { instance = this; } }
// Singleton pattern private void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; } }
public void SendData() { string delimter = " | "; Text tTargets = GameObject.Find("targets" + SensorID).GetComponent <Text>(); Text tStat = GameObject.Find("stat" + SensorID).GetComponent <Text>(); RadarManager rm = gameObject.GetComponentInParent <RadarManager>(); if (!rm) { return; } string s = SensorID.ToString() /* Host Data */ + delimter + rb.velocity.magnitude.ToString("##0.000") + delimter + rb.angularVelocity.magnitude.ToString("##0.000") + delimter + rb.transform.position.x.ToString("##0.000") + delimter + rb.transform.position.z.ToString("##0.000") /* Sensor Data */ + delimter + transform.parent.transform.localEulerAngles.y.ToString("000.0") + delimter + this.range.ToString("##0.00") + delimter + this.FieldOfView.ToString("##0.00") ; tStat.text = s; if (TargetList.Count == 0) { tTargets.text = ""; return; } string ts = ""; int tCount = 0; foreach (KeyValuePair <int, Target> t in TargetList) { ts = ts + tCount.ToString() + ":" + t.Value.ToString(); tCount++; } tTargets.text = ts; }
// Use this for initialization void Start() { if (instance) { Destroy(gameObject); } else { instance = this; } radarUI = GetComponent <RadarOnUI>(); radarUpgrades = GetComponent <RadarUpgrades>(); myDirectionRadar = directionRadar.north; nbRound = 10; nbRoundMax = 10; zones.Clear(); GetRandomZoneRadar(); infoRadar.text = "Default"; }
void Start() { rmData = GetComponent<RadarManager>(); rocketHUD = GameObject.Find ("fake weapon hud").GetComponent<Image>();; rocketHUD.gameObject.SetActive(true); SpeedReadout = GameObject.Find("Speed"); throttleReadout = GameObject.Find("Throttle"); if(optionalDangerHeightReadout) { dangerBaseText = optionalDangerHeightReadout.text; } mFlash = GetComponent<MuzzleFlash>(); mFlash.Reset(); StartCoroutine(rocketSalvoRelease()); shootableScript = GetComponent<Shootable>(); wasHealth = startHealth = shootableScript.healthLimit; UI_ThrottleReadout = throttleReadout.GetComponent<UI_Speed> (); UI_SpeedReadout = SpeedReadout.GetComponent<UI_Speed> (); hardpointRef = missionTarget.GetComponentInChildren<HardPointCounter>(); hardpointMax = hardpointRef.hardpointCount; }
// Start is called before the first frame update private void Start() { radarManager = RadarManager.Instance; }
private void Awake() { Instance = this; radar = FindObjectOfType <RadarManager>(); _playing = true; }