private void OnEnable()
 {
     stop             = false;
     UIcontroller     = FindObjectOfType <UI_control>();
     rb               = GetComponent <Rigidbody>();
     sum              = 0.001f;
     horizontal_speed = 0f;
     vertical_speed   = 0f;
 }
Esempio n. 2
0
 private void Awake()
 {
     uI_Control        = GetComponent <UI_control>();
     basePanelPosition = init_pos.position;
     str           = dropdown.captionText.text.Split('*');
     maxpath_count = 5;
     Produce(maxpath_count, true, basePanelPosition, Get_Size(), ConstClass.nowfloor);
     ConstClass.nowfloor++;
     panelList[0].GetComponent <SinglePanel>().IsAppearance = true;
     panelList[0].GetComponent <SinglePanel>().IsHave       = false;
     panelList[0].GetComponent <SinglePanel>().IsSelet      = false;
     HideButton.gameObject.SetActive(false);
     ShowButton.gameObject.SetActive(false);
 }
Esempio n. 3
0
 // Start is called before the first frame update
 void Start()
 {
     uI_Control = GetComponent <UI_control>();
 }
 private void Start()
 {
     points       = GameObject.Find("Pellets");
     UIcontroller = FindObjectOfType <UI_control>();
     Debug.Log("All Points: " + points.transform.childCount.ToString());
 }
Esempio n. 5
0
    private void Awake()
    {
        UI_control UI      = GameObject.Find("Canvas").GetComponent <UI_control>();
        int        shipnum = 0;
        GameObject ship;

        if (GameObject.FindGameObjectWithTag("GlobalObj"))
        {
            shipnum = GameObject.FindGameObjectWithTag("GlobalObj").GetComponent <GameDataManager>().shipnum;
        }
        switch (shipnum)
        {
        case 1:
            ship = GameObject.Instantiate(smallship) as GameObject;
            ship.transform.position = ship_pos.transform.position;


            shipcam.GetComponent <ShipCamControl>().player         = ship.transform.Find("center/CamFllow");
            shipcam.GetComponent <ShipCamControl>().center         = ship.transform.Find("center");
            shipcam.GetComponent <ShipCamControl>().FishingCam_Pos = ship.transform.Find("fish_camera_pos").gameObject;
            shipcam.GetComponent <ShipCamControl>().minzoom        = -1f;
            shipcam.GetComponent <ShipCamControl>().maxzoom        = 60f;

            mapcam.GetComponent <MapCameraMove>().target  = ship.gameObject;
            ship_pos_ui.GetComponent <Ship_Pos_UI>().ship = ship.gameObject;
            UI.ship = ship;


            fishing_script.GetComponent <FishingUIcontrol>().fishnetobj     = ship.transform.Find("fishnet").gameObject;
            fishing_script.GetComponent <FishingUIcontrol>().fishnet_height = 3.4f;

            UI.gas = UI.shipgas = 200;
            break;

        case 2:
            ship = GameObject.Instantiate(middleship) as GameObject;
            ship.transform.position = ship_pos.transform.position;


            shipcam.GetComponent <ShipCamControl>().player         = ship.transform.Find("center/CamFllow");
            shipcam.GetComponent <ShipCamControl>().center         = ship.transform.Find("center");
            shipcam.GetComponent <ShipCamControl>().FishingCam_Pos = ship.transform.Find("fish_camera_pos").gameObject;
            shipcam.GetComponent <ShipCamControl>().minzoom        = 10f;
            shipcam.GetComponent <ShipCamControl>().maxzoom        = 85f;

            mapcam.GetComponent <MapCameraMove>().target        = ship.gameObject;
            ship_pos_ui.GetComponent <Ship_Pos_UI>().ship       = ship.gameObject;
            dunker_pos_ui.GetComponent <Dunker_Pos_UI>().dunker = ship.transform.Find("dunker").gameObject;
            canvas.GetComponent <gas_Distance_Manager>().dunker = ship.transform.Find("dunker").gameObject;

            UI.ship   = ship;
            UI.dunker = ship.transform.Find("dunker").gameObject;

            fishing_script.GetComponent <FishingUIcontrol>().fishnetobj     = ship.transform.Find("fishnet").gameObject;
            fishing_script.GetComponent <FishingUIcontrol>().fishnet_height = 6f;

            dunker_cam.GetComponent <DunkerCamControl>().center = ship.transform.Find("dunker/center");
            dunker_cam.GetComponent <DunkerCamControl>().follow = ship.transform.Find("dunker/center/Camfw");

            direction_img.GetComponent <direction_UI>().dunker = ship.transform.Find("dunker").gameObject;

            UI.gas = UI.shipgas = 400;
            break;

        case 3:
            UI.gas = UI.shipgas = 700;
            break;

        default:
            UI.gas = UI.shipgas = 100;
            Debug.Log("船只信息丢失");
            break;
        }
    }