Inheritance: MonoBehaviour
コード例 #1
0
    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;
    }
コード例 #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
コード例 #3
0
ファイル: RadarManager.cs プロジェクト: jkaurich/3D-Radar
 // Singleton pattern
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
コード例 #4
0
ファイル: Scanner.cs プロジェクト: ExtremeGTX/FusionCity
    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;
    }
コード例 #5
0
    // 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";
    }
コード例 #6
0
    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;
    }
コード例 #7
0
ファイル: Radar3D.cs プロジェクト: jkaurich/3D-Radar
 // Start is called before the first frame update
 private void Start()
 {
     radarManager = RadarManager.Instance;
 }
コード例 #8
0
ファイル: GameManager.cs プロジェクト: DorsalFin/bird-dome
 private void Awake()
 {
     Instance = this;
     radar    = FindObjectOfType <RadarManager>();
     _playing = true;
 }