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>(); pwrMngr.PowerSetup(systemType, powerReq); originMedBayScr = GetOriginMedBay(); if (this == originMedBayScr) { isOrigin = true; } //originEngScr.fullPwrReq += powerReq; if (isOrigin) { pwrMngr.AddToSysScrList(systemType, sysScr); StartCoroutine(HealRoutine()); } }
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 SystemScript systemScr; void Start() { sysScr = gameObject.GetComponent <SystemScript> (); gridPos = sysScr.GridPos; GameObject _ship = transform.parent.parent.parent.parent.gameObject; pwrMngr = _ship.GetComponent <ShipPowerMngr> (); hScr = gameObject.GetComponent <HealthScript> (); originReactorScr = GetOriginReactor(); originReactorScr.fullCapacity += componentCapacity; if (this == originReactorScr) { isOrigin = true; } //ReactorSetup (); //if !inEditor if (CasheScript.Instance.GameMode != 0) { pwrMngr.PowerSetup(systemType, componentCapacity); if (isOrigin) { pwrMngr.AddToSysScrList(systemType, sysScr); } } }
private void Setup() { sysScr = GetComponent <SystemScript>(); gridPos = sysScr.GridPos; //needs more info... //ship = LevelManager.Instance.Ships [playerID].GetComponent <ShipScript> (); GameObject _ship = transform.parent.parent.parent.parent.gameObject; //ShipScript _shipScr = _ship.GetComponent <ShipScript> (); pwrMngr = _ship.GetComponent <ShipPowerMngr> (); hScr = sysScr.GetOriginObj().GetComponent <HealthScript> (); //Debug.LogError (_ship.transform.childCount); if (_ship.transform.childCount < 7) { //if (_ship.transform.GetChild (7) == null) { //Debug.LogError ("shield stuff called"); GameObject _shield = (GameObject)Instantiate(shield, _ship.transform); shield = _shield; shieldScr = shield.GetComponent <ShieldScript> (); shieldScr.Setup(gridPos.Z); /* * GameObject _field = _ship.transform.GetChild (1).gameObject; * * shield.transform.position = _field.transform.position; * shield.transform.localScale = (_field.transform.localScale * 16 / 1920); * //float _scale = (Screen.width / shield.GetComponent <SpriteRenderer> ().bounds.size.x); * float _scale0 = (_field.transform.localScale.x * 16 / 1920); * float _scale1 = (_field.transform.localScale.y * 16 / 1080); * //shield.transform.localScale = new Vector3 (_scale, _scale, _scale); * * shield.transform.localScale = new Vector3 (_scale0, _scale1); */ } else { //Debug.LogError ("no shield stuff called"); shield = _ship.transform.GetChild(6).gameObject; shieldScr = shield.GetComponent <ShieldScript> (); } //IncreaseShieldCapacity (shieldBoost); pwrMngr.PowerSetup(systemType, powerReq); originShldSys = GetOriginShielSystem(); originShldSys.fullPwrReq += powerReq; if (this == originShldSys) { isOrigin = true; pwrMngr.AddToSysScrList(systemType, sysScr); } }
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); originEngScr = GetOriginEngine(); if (this == originEngScr) { isOrigin = true; } originEngScr.fullPwrReq += powerReq; if (isOrigin) { pwrMngr.AddToSysScrList(systemType, sysScr); } /* 220418 * if (NetManager.Instance != null) { * if (playerID == NetManager.Instance.localPlayerID) { * PowerManager.Instance.GetEngine (this); * PowerManager.Instance.UpdateSystemCapacity (systemType, powerReq); * isLocal = true; * } * } */ }
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); weaponSysScr = GetOriginWeaponSys(); if (this == weaponSysScr) { isOrigin = true; pwrMngr.AddToSysScrList(systemType, sysScr); } weaponSysScr.fullPwrReq += powerReq; }