Exemplo n.º 1
0
    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>();
    }
Exemplo n.º 2
0
    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());
        }
    }
Exemplo n.º 3
0
    //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);
            }
        }
    }
Exemplo n.º 4
0
    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);
        }
    }
Exemplo n.º 5
0
    public void PlaceObj(int _index, Point _gridPos, GameObject _originObj)
    {
        gridPos = _gridPos;
        tile    = LevelManager.Instance.Tiles [gridPos];
        shipScr = LevelManager.Instance.Ships [gridPos.Z].GetComponent <ShipScript> ();
        pwrMngr = shipScr.gameObject.GetComponent <ShipPowerMngr> ();

        saveStr = (objStr + ",7," + gridPos.X.ToString() + "," + gridPos.Y.ToString());
        LevelManager.Instance.parameterList.Add(saveStr);

        transform.SetParent(tile.transform);

        //DEBUG
        tile.WeaponPlacable = false;

        GameManager.Instance.Buy();

        shipScr.AddWeaponToList(this);
    }
Exemplo n.º 6
0
    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;
         *      }
         * }
         */
    }
Exemplo n.º 7
0
    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;
    }
Exemplo n.º 8
0
 private void Start()
 {
     powerMngr = LevelManager.Instance.Ships[NetManager.Instance.localPlayerID].GetComponent <ShipPowerMngr>(); //NetManager.Instance.localPlayerID
 }
Exemplo n.º 9
0
    void Start()
    {
        ShipScript _ship = LevelManager.Instance.Ships [0].GetComponent <ShipScript> ();

        pwrMngr = _ship.GetComponent <ShipPowerMngr> ();
    }