Пример #1
0
    private void RpcSyncPowerstate(Vector3 _pos, bool _isPowered)
    {
        Point      _point = VectorToPoint(_pos);
        TileScript _tile  = LevelManager.Instance.Tiles [_point];

        SystemScript _sysScr = _tile.GetSystem();

        _sysScr.ReceivePowerUpdate(_isPowered);


        /*
         * //weapons
         * if (_type == 1) {
         *      //WeaponScript _weapon = LevelManager.Instance.Tiles [_point].transform.GetChild (0).GetComponent <WeaponScript> ();
         *      WeaponScript _weapon = _tile.transform.GetChild (0).GetComponent <WeaponScript> ();
         *      //should perhaps be done by function
         *      //_weapon.IsPowered = _isPowered;
         *      _weapon.FirePower (_isPowered);
         *
         * //engines and other systems? //-> interface!
         * } else if (_type == 2) {
         *      EngineScript _engine = _tile.transform.GetChild (1).GetChild (0).GetComponent <EngineScript> ();
         *      _engine.SyncedPower (_isPowered);
         * }
         */
    }