예제 #1
0
 // Use this for initialization
 void Start()
 {
     if (hp == null)
     {
         hp = GetComponent <NewHp>();
     }
 }
예제 #2
0
    private void Start()
    {
        if (center == null)
        {
            center = GameObject.FindGameObjectWithTag("KeepPlayer").GetComponent <Center>();
        }
        center.isPlane = true;

        if (mainCamera == null)
        {
            mainCamera = GameObject.FindGameObjectWithTag("MainCamera");
            //camOffset = mainCamera.transform.position - transform.position;
        }

        if (dockGuide == null)
        {
            dockGuide = GetComponent <DockGuide>();
        }
        if (ausource == null)
        {
            Debug.Log(GameObject.Find("PlayerModel").transform.position);
            Debug.Log(GameObject.Find("PlayerModel"));
            ausource = GameObject.Find("PlayerModel").GetComponent <AudioSource>();
        }
        if (hp == null)
        {
            hp = GetComponent <NewHp>();
        }

        if (speedometer == null)
        {
            speedometer = GameObject.FindGameObjectWithTag("Speedometer").GetComponent <Text>();
        }

        if (indicator == null)
        {
            indicator = GameObject.FindGameObjectWithTag("Indicator");
        }
        hud = GameObject.Find(indicator.name + "/hud");
        hor = GameObject.Find(indicator.name + "/hor");
        ver = GameObject.Find(indicator.name + "/ver");
        if (easyControl == null)
        {
            easyControl = GameObject.Find("EasyControlButton").GetComponent <Toggle>();
        }

        easyControl.onValueChanged.AddListener((bool value) => StabZ(value));
    }