private void OnTriggerEnter2D(Collider2D collision) { SpaceShipMovment sm = GameObject.Find("Player").GetComponent <SpaceShipMovment>(); if (sm != null) { sm.is_in_docking_zone = true; } plyer_in_landing_zone = true; }
public void Equip(GameObject obj) { if (modules_game_object == null) { modules_game_object = GameObject.Find("Modules"); } ModuleSystemInfo module_info = obj.GetComponent <ModuleSystemInfo>(); ItemResorce ir = obj.GetComponent <ItemResorce>(); SpaceShipMovment controls = gameObject.GetComponent <SpaceShipMovment>(); obj.transform.parent = modules_game_object.transform; if (ir.Item_type == Enums.enum_item.module_command_module_type1) { command_module = obj.GetComponent <ShipModule>(); //First we need to store the item command_module.LoadMountPoints(); MountPoint mp = command_module.mount_points[0]; //Set the max storage command_module.ShowMountPoints(); max_storage_items = module_info.max_storage_items; mp.max_mounting = max_storage_items; } else { MountPoint mp = command_module.mount_points[module_info.mount_point]; obj.transform.position = mp.transform.position; obj.transform.rotation = mp.transform.rotation; module_info.mount_point = mp.index; module_info.key_mappings = mp.key_mappings; module_info.SetRenderOrder(mp.render_order); } foreach (KeyMappingModel e in module_info.key_mappings) { controls.AddKeyBinding(e, obj); } module_info.IteminUse(module_info.is_internal_module); }
// Start is called before the first frame update private void Start() { if (player_prefab == null) { return; } //******************************************************* //Lets look at the what type of data we are going to read //******************************************************* if (data_type == Enums.enum_system_info.flight_assist || data_type == Enums.enum_system_info.landing_zone) { //************************* //This is icon data boolean //************************* ship_movment = player_prefab.GetComponent <SpaceShipMovment>(); sr = GetComponentInChildren <Image>(); } else if (data_type == Enums.enum_system_info.refiner) { GameObject r = GameObject.Find("Refiner(Clone)"); bar = GetComponentInChildren <Slider>(); } else { //************************************** //This is slider data from ShipManagment //************************************** sys = player_prefab.GetComponent <ShipManagment>(); bar = GetComponentInChildren <Slider>(); } //******************************************* //Lets start te reading //******************************************* InvokeRepeating("UpdateDisplayData", 0, 0.1f); }