private void Setup() { sysScr = GetComponent <SystemScript>(); gridPos = sysScr.GridPos; playerID = gridPos.Z; ship = LevelManager.Instance.Ships[playerID].GetComponent <ShipScript>(); pwrMngr = ship.GetComponent <ShipPowerMngr>(); hScr = sysScr.GetOriginObj().GetComponent <HealthScript>(); //ship.IncreaseEvasionChance (componentCapacity); pwrMngr.PowerSetup(systemType, powerReq); originTeleporterScr = GetOriginTelScr(); if (this == originTeleporterScr) { isOrigin = true; } originTeleporterScr.fullPwrReq += powerReq; if (isOrigin) { pwrMngr.AddToSysScrList(systemType, sysScr); } RoomScript _room = transform.parent.parent.GetChild(0).GetChild(0).GetComponent <RoomScript>(); room = _room.GetOriginObj().GetComponent <RoomScript>(); }
private void Setup() { SubSystemScript _subSysScr = gameObject.GetComponent <SubSystemScript> (); gridPos = _subSysScr.GridPos; ship = LevelManager.Instance.Ships [_subSysScr.GridPos.Z].GetComponent <ShipScript> (); GameObject _sysObj = transform.parent.parent.GetChild(1).gameObject; if (_sysObj.transform.childCount > 0) { if (_sysObj.transform.GetChild(0).GetComponent <WeaponSysScr>() != null) { weaponSysScr = _sysObj.transform.GetChild(0).GetComponent <WeaponSysScr>(); isWeaponTerminal = true; } else if (_sysObj.transform.GetChild(0).GetComponent <TeleporterScr>() != null) { teleporterScr = _sysObj.transform.GetChild(0).GetComponent <TeleporterScr>(); isTeleporterTerminal = true; } else { Debug.LogError("/*weaponSysScr*/ someSysScr == null"); } } }
private TeleporterScr GetOriginTelScr() { TeleporterScr _telScr = sysScr.GetOriginObj().GetComponent <TeleporterScr>(); return(_telScr); }