Example #1
0
        private void listHistory_DoubleClick(object sender, EventArgs e)
        {
            WebBrowser webBrowser = (WebBrowser)MyProject.Forms.fMain.tcWeb.SelectedTab.Controls[0];
            // ISSUE: variable of the null type
            __Null local1     = null;
            string MemberName = "Navigate";

            object[] objArray1   = new object[1];
            object[] objArray2   = objArray1;
            int      index       = 0;
            ListBox  listHistory = this.listHistory;
            object   objectValue = RuntimeHelpers.GetObjectValue(listHistory.SelectedItem);

            objArray2[index] = objectValue;
            object[] objArray3 = objArray1;
            object[] Arguments = objArray3;
            // ISSUE: variable of the null type
            __Null local2 = null;
            // ISSUE: variable of the null type
            __Null local3 = null;

            bool[] flagArray = new bool[1]
            {
                true
            };
            bool[] CopyBack = flagArray;
            int    num      = 1;

            NewLateBinding.LateCall((object)webBrowser, (System.Type)local1, MemberName, Arguments, (string[])local2, (System.Type[])local3, CopyBack, num != 0);
            if (!flagArray[0])
            {
                return;
            }
            listHistory.SelectedItem = RuntimeHelpers.GetObjectValue(objArray3[0]);
        }
Example #2
0
    public override void Process(uint seed)
    {
        List <PathList>    pathListList = new List <PathList>();
        TerrainHeightMap   heightMap    = TerrainMeta.HeightMap;
        TerrainTopologyMap topologyMap  = TerrainMeta.TopologyMap;
        List <Vector3>     vector3List  = new List <Vector3>();

        for (float z = (float)TerrainMeta.Position.z; (double)z < TerrainMeta.Position.z + TerrainMeta.Size.z; z += 50f)
        {
            for (float x = (float)TerrainMeta.Position.x; (double)x < TerrainMeta.Position.x + TerrainMeta.Size.x; x += 50f)
            {
                Vector3 worldPos;
                ((Vector3) ref worldPos).\u002Ector(x, 0.0f, z);
                float num1 = (float)(double)(worldPos.y = (__Null)heightMap.GetHeight(worldPos));
                if (worldPos.y > 5.0)
                {
                    Vector3 normal1 = heightMap.GetNormal(worldPos);
                    if (normal1.y > 0.00999999977648258)
                    {
                        Vector2 vector2    = new Vector2((float)normal1.x, (float)normal1.z);
                        Vector2 normalized = ((Vector2) ref vector2).get_normalized();
                        vector3List.Add(worldPos);
                        float radius = 12f;
                        int   num2   = 12;
                        for (int index = 0; index < 10000; ++index)
                        {
                            ref __Null local1 = ref worldPos.x;
Example #3
0
 private void PreDraw(GameTime gameTime)
 {
     this.ValidateRenderTargets();
     if (!this._usingRenderTargets || !Main.IsGraphicsDeviceAvailable)
     {
         return;
     }
     if (this._useProjectileWaves || this._useRippleWaves || (this._useCustomWaves || this._usePlayerWaves))
     {
         for (int index = 0; index < Math.Min(this._queuedSteps, 2); ++index)
         {
             this.StepLiquids();
         }
     }
     else if (this._isWaveBufferDirty || this._clearNextFrame)
     {
         GraphicsDevice graphicsDevice   = Main.instance.GraphicsDevice;
         RenderTarget2D distortionTarget = this._distortionTarget;
         graphicsDevice.SetRenderTarget(distortionTarget);
         Color color = new Color(0.5f, 0.5f, 0.0f, 1f);
         graphicsDevice.Clear(color);
         this._clearNextFrame    = false;
         this._isWaveBufferDirty = false;
         // ISSUE: variable of the null type
         __Null local = null;
         graphicsDevice.SetRenderTarget((RenderTarget2D)local);
     }
     this._queuedSteps = 0;
 }
        private static float IsInRange(NPCHumanContext c, BaseMountable mountable)
        {
            Vector3 vector3 = Vector3.op_Subtraction(((Component)mountable).get_transform().get_position(), c.Position);

            if (vector3.y > (double)mountable.maxMountDistance)
            {
                ref __Null local = ref vector3.y;
Example #5
0
        private void FixupSpecialObject(ObjectHolder holder)
        {
            ISurrogateSelector selector = (ISurrogateSelector)null;

            if (holder.HasSurrogate)
            {
                ISerializationSurrogate surrogate = holder.Surrogate;
                object obj = surrogate.SetObjectData(holder.ObjectValue, holder.SerializationInfo, this.m_context, selector);
                if (obj != null)
                {
                    if (!holder.CanSurrogatedObjectValueChange && obj != holder.ObjectValue)
                    {
                        throw new SerializationException(string.Format((IFormatProvider)CultureInfo.CurrentCulture, Environment.GetResourceString("Serialization_NotCyclicallyReferenceableSurrogate"), (object)surrogate.GetType().FullName));
                    }
                    holder.SetObjectValue(obj, this);
                }
                holder.m_surrogate = (ISerializationSurrogate)null;
                holder.SetFlags();
            }
            else
            {
                this.CompleteISerializableObject(holder.ObjectValue, holder.SerializationInfo, this.m_context);
            }
            holder.SerializationInfo    = (SerializationInfo)null;
            holder.RequiresSerInfoFixup = false;
            if (holder.RequiresValueTypeFixup && holder.ValueTypeFixupPerformed)
            {
                // ISSUE: variable of the null type
                __Null       local       = null;
                ObjectHolder holder1     = holder;
                object       objectValue = holder1.ObjectValue;
                this.DoValueTypeFixup((FieldInfo)local, holder1, objectValue);
            }
            this.DoNewlyRegisteredObjectFixups(holder);
        }
Example #6
0
            public override void Update(WorldMapController self)
            {
                this.mTransition = Mathf.Clamp01(this.mTransition + 1f / self.TransitionTime * Time.get_deltaTime());
                float opacity = Mathf.Sin((float)((double)this.mTransition * 3.14159274101257 * 0.5));

                this.mTarget.SetOpacity(opacity);
                self.mTransform.set_anchoredPosition(Vector2.Lerp(self.mDefaultPosition, this.mDesiredPosition, opacity));
                ((Transform)self.mTransform).set_localScale(Vector2.op_Implicit(Vector2.Lerp(self.mDefaultScale, this.mDesiredScale, opacity)));
                self.SetRadialBlurStrength(this.mTransition);
                if (Object.op_Inequality((Object)self.RadialBlurEffect, (Object)null))
                {
                    // ISSUE: variable of the null type
                    __Null x     = this.mTargetPosition.x;
                    Rect   rect1 = self.mTransform.get_rect();
                    // ISSUE: explicit reference operation
                    double width = (double)((Rect)@rect1).get_width();
                    float  num1  = (float)(x / width + 0.5);
                    // ISSUE: variable of the null type
                    __Null y     = this.mTargetPosition.y;
                    Rect   rect2 = self.mTransform.get_rect();
                    // ISSUE: explicit reference operation
                    double height = (double)((Rect)@rect2).get_height();
                    float  num2   = (float)(y / height + 0.5);
                    self.RadialBlurEffect.Focus = new Vector2(num1, num2);
                }
                if ((double)this.mTransition < 1.0)
                {
                    return;
                }
                self.mStateMachine.GotoState <WorldMapController.State_AreaSelect>();
            }
    private Texture2D CreateTexture()
    {
        if (this.entries.Count <= 0)
        {
            return((Texture2D)null);
        }
        int length = 32;
        int num1   = Mathf.Max(this.entries.Count, 64);

        this.ReleaseTexture();
        this.texture = new Texture2D(length, num1, (TextureFormat)17, false, true);
        ((Object)this.texture).set_name("SubsurfaceProfiles");
        ((UnityEngine.Texture) this.texture).set_wrapMode((TextureWrapMode)1);
        ((UnityEngine.Texture) this.texture).set_filterMode((FilterMode)1);
        Color[] pixels = this.texture.GetPixels(0);
        for (int index = 0; index < pixels.Length; ++index)
        {
            pixels[index] = Color.get_clear();
        }
        Color[] target = new Color[length];
        for (int index1 = 0; index1 < this.entries.Count; ++index1)
        {
            SubsurfaceProfileData data = this.entries[index1].data;
            data.SubsurfaceColor = SubsurfaceProfileTexture.ColorClamp(data.SubsurfaceColor, 0.0f, 1f);
            data.FalloffColor    = SubsurfaceProfileTexture.ColorClamp(data.FalloffColor, 0.009f, 1f);
            target[0]            = data.SubsurfaceColor;
            target[0].a          = (__Null)0.0;
            SeparableSSS.CalculateKernel(target, 1, 13, data.SubsurfaceColor, data.FalloffColor);
            SeparableSSS.CalculateKernel(target, 14, 9, data.SubsurfaceColor, data.FalloffColor);
            SeparableSSS.CalculateKernel(target, 23, 6, data.SubsurfaceColor, data.FalloffColor);
            int num2 = length * (num1 - index1 - 1);
            for (int index2 = 0; index2 < 29; ++index2)
            {
                Color      color = Color.op_Multiply(target[index2], new Color(1f, 1f, 1f, 0.3333333f));
                ref __Null local = ref color.a;
Example #8
0
        private void SetParticleProperties()
        {
            if (!Object.op_Implicit((Object)this.m_Particles) || !((Component)this.m_Particles).get_gameObject().get_activeSelf())
            {
                return;
            }
            float num1 = Mathf.Clamp01((float)(1.0 - (double)this.m_Master.fresnelPow / 10.0));
            float num2 = this.m_Master.fadeEnd * this.spawnMaxDistance;
            float num3 = num2 * this.density;
            int   num4 = (int)((double)num3 * 4.0);

            ParticleSystem.MainModule  main          = this.m_Particles.get_main();
            ParticleSystem.MinMaxCurve startLifetime = ((ParticleSystem.MainModule) ref main).get_startLifetime();
            ((ParticleSystem.MinMaxCurve) ref startLifetime).set_mode((ParticleSystemCurveMode)3);
            ((ParticleSystem.MinMaxCurve) ref startLifetime).set_constantMin(4f);
            ((ParticleSystem.MinMaxCurve) ref startLifetime).set_constantMax(6f);
            ((ParticleSystem.MainModule) ref main).set_startLifetime(startLifetime);
            ParticleSystem.MinMaxCurve startSize = ((ParticleSystem.MainModule) ref main).get_startSize();
            ((ParticleSystem.MinMaxCurve) ref startSize).set_mode((ParticleSystemCurveMode)3);
            ((ParticleSystem.MinMaxCurve) ref startSize).set_constantMin(this.size * 0.9f);
            ((ParticleSystem.MinMaxCurve) ref startSize).set_constantMax(this.size * 1.1f);
            ((ParticleSystem.MainModule) ref main).set_startSize(startSize);
            ParticleSystem.MinMaxGradient startColor = ((ParticleSystem.MainModule) ref main).get_startColor();
            if (this.m_Master.colorMode == ColorMode.Flat)
            {
                ((ParticleSystem.MinMaxGradient) ref startColor).set_mode((ParticleSystemGradientMode)0);
                Color      color = this.m_Master.color;
                ref __Null local = ref color.a;
Example #9
0
 public bool tickUpdate(GameTime time)
 {
     if (this.forceProceed)
     {
         return(true);
     }
     if (this.whichQuestion != 2 || Game1.dialogueUp)
     {
         return(!Game1.dialogueUp);
     }
     if (Game1.activeClickableMenu == null)
     {
         NamingMenu.doneNamingBehavior b = new NamingMenu.doneNamingBehavior(this.animalHouse.addNewHatchedAnimal);
         string title;
         if (this.animal == null)
         {
             title = Game1.content.LoadString("Strings\\StringsFromCSFiles:QuestionEvent.cs.6692");
         }
         else
         {
             title = Game1.content.LoadString("Strings\\Events:AnimalNamingTitle", (object)this.animal.displayType);
         }
         // ISSUE: variable of the null type
         __Null local = null;
         Game1.activeClickableMenu = (IClickableMenu) new NamingMenu(b, title, (string)local);
     }
     return(false);
 }
Example #10
0
    private Vector2 GetPivotInSprite(Sprite sprite)
    {
        Vector2 vector2 = (Vector2)null;

        if (Object.op_Inequality((Object)null, (Object)sprite))
        {
            Bounds bounds1 = sprite.get_bounds();
            if (((Bounds) ref bounds1).get_size().x != 0.0)
            {
                ref Vector2 local   = ref vector2;
                Bounds      bounds2 = sprite.get_bounds();
                // ISSUE: variable of the null type
                __Null x1      = ((Bounds) ref bounds2).get_center().x;
                Bounds bounds3 = sprite.get_bounds();
                // ISSUE: variable of the null type
                __Null x2  = ((Bounds) ref bounds3).get_size().x;
                double num = 0.5 - x1 / x2;
                local.x = (__Null)num;
            }
            Bounds bounds4 = sprite.get_bounds();
            if (((Bounds) ref bounds4).get_size().y != 0.0)
            {
                ref Vector2 local   = ref vector2;
                Bounds      bounds2 = sprite.get_bounds();
                // ISSUE: variable of the null type
                __Null y1      = ((Bounds) ref bounds2).get_center().y;
                Bounds bounds3 = sprite.get_bounds();
                // ISSUE: variable of the null type
                __Null y2  = ((Bounds) ref bounds3).get_size().y;
                double num = 0.5 - y1 / y2;
                local.y = (__Null)num;
            }
Example #11
0
 internal static bool VerifySignature(SafeCspHandle cspHandle, SafeCspKeyHandle keyHandle, CapiNative.AlgorithmID signatureAlgorithm, CapiNative.AlgorithmID hashAlgorithm, byte[] hashValue, byte[] signature)
 {
     byte[] numArray = new byte[signature.Length];
     Array.Copy((Array)signature, (Array)numArray, numArray.Length);
     Array.Reverse((Array)numArray);
     using (SafeCspHashHandle hashAlgorithm1 = CapiNative.CreateHashAlgorithm(cspHandle, hashAlgorithm))
     {
         if (hashValue.Length != CapiNative.GetHashPropertyInt32(hashAlgorithm1, CapiNative.HashProperty.HashSize))
         {
             throw new CryptographicException(-2146893822);
         }
         CapiNative.SetHashProperty(hashAlgorithm1, CapiNative.HashProperty.HashValue, hashValue);
         SafeCspHashHandle hHash       = hashAlgorithm1;
         byte[]            pbSignature = numArray;
         int length = pbSignature.Length;
         SafeCspKeyHandle hPubKey = keyHandle;
         // ISSUE: variable of the null type
         __Null local   = null;
         int    dwFlags = 0;
         if (CapiNative.UnsafeNativeMethods.CryptVerifySignature(hHash, pbSignature, length, hPubKey, (string)local, dwFlags))
         {
             return(true);
         }
         int lastWin32Error = Marshal.GetLastWin32Error();
         if (lastWin32Error != -2146893818)
         {
             throw new CryptographicException(lastWin32Error);
         }
         return(false);
     }
 }
Example #12
0
            public void LBL(ref string sText)
            {
                object Instance = this._ref;
                // ISSUE: variable of the null type
                __Null local1     = null;
                string MemberName = nameof(LBL);

                object[] objArray = new object[1] {
                    (object)sText
                };
                object[] Arguments = objArray;
                // ISSUE: variable of the null type
                __Null local2 = null;
                // ISSUE: variable of the null type
                __Null local3 = null;

                bool[] flagArray = new bool[1] {
                    true
                };
                bool[] CopyBack = flagArray;
                int    num      = 1;

                NewLateBinding.LateCall(Instance, (Type)local1, MemberName, Arguments, (string[])local2, (Type[])local3, CopyBack, num != 0);
                if (!flagArray[0])
                {
                    return;
                }
                sText = (string)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray[0]), typeof(string));
            }
Example #13
0
    public void Register()
    {
        Bounds bounds1 = this.collider.get_bounds();

        this.center = ((Bounds) ref bounds1).get_center();
        Bounds bounds2 = this.collider.get_bounds();
        // ISSUE: variable of the null type
        __Null x = ((Bounds) ref bounds2).get_extents().x;

        bounds2 = this.collider.get_bounds();
        // ISSUE: variable of the null type
        __Null y   = ((Bounds) ref bounds2).get_extents().y;
        double num = (double)Mathf.Max((float)x, (float)y);

        bounds2 = this.collider.get_bounds();
        // ISSUE: variable of the null type
        __Null z = ((Bounds) ref bounds2).get_extents().z;

        this.radius     = Mathf.Max((float)num, (float)z);
        this.occludeeId = OcclusionCulling.RegisterOccludee(this.center, this.radius, this.renderer.get_enabled(), this.minTimeVisible, this.isStatic, ((Component)this).get_gameObject().get_layer(), new OcclusionCulling.OnVisibilityChanged(this.OnVisibilityChanged));
        if (this.occludeeId < 0)
        {
            Debug.LogWarning((object)("[OcclusionCulling] Occludee registration failed for " + ((Object)this).get_name() + ". Too many registered."));
        }
        this.state = OcclusionCulling.GetStateById(this.occludeeId);
    }
    public static void SampleWaves(
        WaterGerstner.Wave[] waves,
        Vector3 location,
        out Vector3 position,
        out Vector3 normal)
    {
        Vector2 vector2;

        ((Vector2) ref vector2).\u002Ector((float)location.x, (float)location.z);
        float   waveTime = WaterSystem.WaveTime;
        Vector3 zero1    = Vector3.get_zero();
        Vector3 zero2    = Vector3.get_zero();

        for (uint index = 0; (long)index < (long)waves.Length; ++index)
        {
            double     wi     = (double)waves[(int)index].wi;
            float      phi    = waves[(int)index].phi;
            float      wa     = waves[(int)index].WA;
            Vector2    di     = waves[(int)index].Di;
            float      ai     = waves[(int)index].Ai;
            float      qi     = waves[(int)index].Qi;
            double     num1   = (double)Vector2.Dot(di, vector2);
            double     num2   = wi * num1 + (double)phi * (double)waveTime;
            float      num3   = Mathf.Sin((float)num2);
            float      num4   = Mathf.Cos((float)num2);
            ref __Null local1 = ref zero1.x;
Example #15
0
        private static void InitializeModule()
        {
            // ISSUE: variable of the null type
            __Null cameraUpdatedEvent1 = CinemachineCore.CameraUpdatedEvent;

            // ISSUE: reference to a compiler-generated field
            if (CinemachinePostProcessing.\u003C\u003Ef__mg\u0024cache2 == null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method pointer
                CinemachinePostProcessing.\u003C\u003Ef__mg\u0024cache2 = new UnityAction <CinemachineBrain>((object)null, __methodptr(ApplyPostFX));
            }
            // ISSUE: reference to a compiler-generated field
            UnityAction <CinemachineBrain> fMgCache2 = CinemachinePostProcessing.\u003C\u003Ef__mg\u0024cache2;

            ((UnityEvent <CinemachineBrain>)cameraUpdatedEvent1).RemoveListener(fMgCache2);
            // ISSUE: variable of the null type
            __Null cameraUpdatedEvent2 = CinemachineCore.CameraUpdatedEvent;

            // ISSUE: reference to a compiler-generated field
            if (CinemachinePostProcessing.\u003C\u003Ef__mg\u0024cache3 == null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method pointer
                CinemachinePostProcessing.\u003C\u003Ef__mg\u0024cache3 = new UnityAction <CinemachineBrain>((object)null, __methodptr(ApplyPostFX));
            }
            // ISSUE: reference to a compiler-generated field
            UnityAction <CinemachineBrain> fMgCache3 = CinemachinePostProcessing.\u003C\u003Ef__mg\u0024cache3;

            ((UnityEvent <CinemachineBrain>)cameraUpdatedEvent2).AddListener(fMgCache3);
        }
Example #16
0
        private Delegate CreateDelegateInternal(Type delegateType, object firstArgument, DelegateBindingFlags bindingFlags, ref StackCrawlMark stackMark)
        {
            if (delegateType == (Type)null)
            {
                throw new ArgumentNullException("delegateType");
            }
            RuntimeType rtType = delegateType as RuntimeType;
            // ISSUE: variable of the null type
            __Null local = null;

            if (rtType == (RuntimeType)local)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), "delegateType");
            }
            if (!rtType.IsDelegate())
            {
                throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), "delegateType");
            }
            object firstArgument1 = firstArgument;
            int    num            = (int)bindingFlags;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            StackCrawlMark& stackMark1       = @stackMark;
            Delegate        delegateInternal = Delegate.CreateDelegateInternal(rtType, this, firstArgument1, (DelegateBindingFlags)num, stackMark1);

            if (delegateInternal != null)
            {
                return(delegateInternal);
            }
            throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
        }
    private void SetZoom(float z)
    {
        z = Mathf.Clamp(z, this.min, this.max);
        if ((double)z == (double)this.zoom)
        {
            return;
        }
        this.zoom = z;
        Rect    rect1              = (((Component)this.scrollRect).get_transform() as RectTransform).get_rect();
        Rect    rect2              = this.scrollRect.content.get_rect();
        Vector2 vector2            = Vector2.op_Multiply(((Rect) ref rect2).get_size(), this.zoom);
        Vector2 normalizedPosition = this.scrollRect.normalizedPosition;

        if (vector2.x < (double)((Rect) ref rect1).get_width())
        {
            double width = (double)((Rect) ref rect1).get_width();
            rect2 = this.scrollRect.content.get_rect();
            // ISSUE: variable of the null type
            __Null x = ((Rect) ref rect2).get_size().x;
            this.zoom = (float)(width / x);
        }
        if (vector2.y < (double)((Rect) ref rect1).get_height())
        {
            double height = (double)((Rect) ref rect1).get_height();
            rect2 = this.scrollRect.content.get_rect();
            // ISSUE: variable of the null type
            __Null y = ((Rect) ref rect2).get_size().y;
            this.zoom = (float)(height / y);
        }
        ((Transform)this.scrollRect.content).set_localScale(Vector3.op_Multiply(Vector3.get_one(), this.zoom));
        this.scrollRect.normalizedPosition = normalizedPosition;
    }
Example #18
0
            public override void Init(Sprite[] _sprite)
            {
                base.Init(_sprite);
                // ISSUE: variable of the null type
                __Null onValueChanged1 = this.toggleStartup[0].onValueChanged;

                // ISSUE: reference to a compiler-generated field
                if (OptionCtrl.Etc.\u003C\u003Ef__am\u0024cache0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: method pointer
                    OptionCtrl.Etc.\u003C\u003Ef__am\u0024cache0 = new UnityAction <bool>((object)null, __methodptr(\u003CInit\u003Em__0));
                }
                // ISSUE: reference to a compiler-generated field
                UnityAction <bool> fAmCache0 = OptionCtrl.Etc.\u003C\u003Ef__am\u0024cache0;

                ((UnityEvent <bool>)onValueChanged1).AddListener(fAmCache0);
                // ISSUE: variable of the null type
                __Null onValueChanged2 = this.toggleStartup[1].onValueChanged;

                // ISSUE: reference to a compiler-generated field
                if (OptionCtrl.Etc.\u003C\u003Ef__am\u0024cache1 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: method pointer
                    OptionCtrl.Etc.\u003C\u003Ef__am\u0024cache1 = new UnityAction <bool>((object)null, __methodptr(\u003CInit\u003Em__1));
                }
                // ISSUE: reference to a compiler-generated field
                UnityAction <bool> fAmCache1 = OptionCtrl.Etc.\u003C\u003Ef__am\u0024cache1;

                ((UnityEvent <bool>)onValueChanged2).AddListener(fAmCache1);
            }
Example #19
0
        private void AssignIndex(PhotonPlayer player)
        {
            this._indexesLUT = !((Dictionary <object, object>)PhotonNetwork.room.CustomProperties).TryGetValue((object)"PlayerIndexes", out this._indexes) ? new Dictionary <int, int>() : this._indexes as Dictionary <int, int>;
            List <bool> boolList = new List <bool>((IEnumerable <bool>) new bool[PhotonNetwork.room.MaxPlayers]);

            using (Dictionary <int, int> .Enumerator enumerator = this._indexesLUT.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <int, int> current = enumerator.Current;
                    boolList[current.Value] = true;
                }
            }
            this._indexesLUT[player.ID] = Mathf.Max(0, boolList.IndexOf(false));
            Room      room      = PhotonNetwork.room;
            Hashtable hashtable = new Hashtable();

            ((Dictionary <object, object>)hashtable).Add((object)"PlayerIndexes", (object)this._indexesLUT);
            Hashtable propertiesToSet = hashtable;
            // ISSUE: variable of the null type
            __Null local = null;
            int    num   = 0;

            room.SetCustomProperties(propertiesToSet, (Hashtable)local, num != 0);
            this.RefreshData();
        }
Example #20
0
        private void Start()
        {
            this.soundData = new SoundData[6]
            {
                Manager.Config.SoundData.Master,
                Manager.Config.SoundData.BGM,
                Manager.Config.SoundData.GameSE,
                Manager.Config.SoundData.SystemSE,
                Manager.Config.SoundData.ENV,
                Singleton <Manager.Voice> .Instance._Config.PCM
            };
            ((Graphic)((Selectable)this.buttonColor).get_image()).set_color(Manager.Config.GraphicData.BackColor);
            this.toggleShield.set_isOn(Manager.Config.GraphicData.Shield);
            for (int index = 0; index < 6; ++index)
            {
                this.toggleSound[index].set_isOn(!this.soundData[index].Mute);
                ((Selectable)this.sliderSound[index]).set_interactable(!this.soundData[index].Mute);
                this.sliderSound[index].set_value((float)this.soundData[index].Volume);
            }
            // ISSUE: method pointer
            ((UnityEvent)this.buttonColor.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnClickColor)));
            // ISSUE: variable of the null type
            __Null onValueChanged = this.toggleShield.onValueChanged;

            // ISSUE: reference to a compiler-generated field
            if (ConfigCtrl.\u003C\u003Ef__am\u0024cache0 == null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method pointer
                ConfigCtrl.\u003C\u003Ef__am\u0024cache0 = new UnityAction <bool>((object)null, __methodptr(\u003CStart\u003Em__0));
            }
            // ISSUE: reference to a compiler-generated field
            UnityAction <bool> fAmCache0 = ConfigCtrl.\u003C\u003Ef__am\u0024cache0;

            ((UnityEvent <bool>)onValueChanged).AddListener(fAmCache0);
            for (int index = 0; index < 3; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: method pointer
                ((UnityEvent <bool>) this.togglesTexture[index].onValueChanged).AddListener(new UnityAction <bool>((object)new ConfigCtrl.\u003CStart\u003Ec__AnonStorey0()
                {
                    limit = (byte)index
                }, __methodptr(\u003C\u003Em__0)));
            }
            for (int index = 0; index < 6; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                ConfigCtrl.\u003CStart\u003Ec__AnonStorey1 startCAnonStorey1 = new ConfigCtrl.\u003CStart\u003Ec__AnonStorey1();
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey1.\u0024this = this;
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey1.no = index;
                // ISSUE: method pointer
                ((UnityEvent <bool>) this.toggleSound[index].onValueChanged).AddListener(new UnityAction <bool>((object)startCAnonStorey1, __methodptr(\u003C\u003Em__0)));
                // ISSUE: method pointer
                ((UnityEvent <float>) this.sliderSound[index].get_onValueChanged()).AddListener(new UnityAction <float>((object)startCAnonStorey1, __methodptr(\u003C\u003Em__1)));
            }
        }
Example #21
0
 private void CreateItemPreview()
 {
     if (Entity.op_Equality((Entity)this._currentPreview, (Entity)null))
     {
         this.PreviewComplete = false;
         this._currentOffset  = Vector3.get_Zero();
         Prop prop = World.CreateProp(Model.op_Implicit(this._currnetPropHash), (Vector3)null, (Vector3)null, false, false);
         if (Entity.op_Equality((Entity)prop, (Entity)null))
         {
             UI.Notify(string.Format("Failed to load prop, even after request.\nProp Name: {0}", (object)this._currnetPropHash));
             this._resultProp     = (Prop)null;
             this._preview        = false;
             this.PreviewComplete = true;
         }
         else
         {
             ((Entity)prop).set_HasCollision(false);
             this._currentPreview = prop;
             ((Entity)this._currentPreview).set_Alpha(150);
             Database.PlayerPed.get_Weapons().Select((WeaponHash) - 1569615261, true);
             this._resultProp = (Prop)null;
         }
     }
     else
     {
         UiExtended.DisplayHelpTextThisFrame("Press ~INPUT_AIM~ to cancel.\nPress ~INPUT_ATTACK~ to place the item.", true);
         Game.DisableControlThisFrame(2, (Control)25);
         Game.DisableControlThisFrame(2, (Control)24);
         Game.DisableControlThisFrame(2, (Control)257);
         Game.DisableControlThisFrame(2, (Control)152);
         Game.DisableControlThisFrame(2, (Control)153);
         Game.DisableControlThisFrame(2, (Control)44);
         Game.DisableControlThisFrame(2, (Control)27);
         Game.DisableControlThisFrame(2, (Control)172);
         Game.DisableControlThisFrame(2, (Control)173);
         Game.DisableControlThisFrame(2, (Control)21);
         GameExtended.DisableWeaponWheel();
         if (Game.IsDisabledControlPressed(2, (Control)25))
         {
             ((Entity)this._currentPreview).Delete();
             this._currentPreview = this._resultProp = (Prop)null;
             this._preview        = false;
             this.PreviewComplete = true;
             ScriptEventHandler.Instance.UnregisterScript(new EventHandler(this.OnTick));
         }
         else
         {
             Vector3       position      = GameplayCamera.get_Position();
             Vector3       direction     = GameplayCamera.get_Direction();
             RaycastResult raycastResult = World.Raycast(position, Vector3.op_Addition(position, Vector3.op_Multiply(direction, 15f)), (IntersectOptions) - 1, (Entity)Database.PlayerPed);
             Vector3       hitCoords     = ((RaycastResult) ref raycastResult).get_HitCoords();
             if (Vector3.op_Inequality(hitCoords, Vector3.get_Zero()) && (double)((Vector3) ref hitCoords).DistanceTo(Database.PlayerPosition) > 1.5)
             {
                 ItemPreview.DrawScaleForms();
                 float num = Game.IsControlPressed(2, (Control)21) ? 1.5f : 1f;
                 if (Game.IsControlPressed(2, (Control)152))
                 {
                     Vector3    rotation = ((Entity)this._currentPreview).get_Rotation();
                     ref __Null local    = ref rotation.Z;
        public virtual bool UnregisterAssembly(Assembly assembly)
        {
            if (assembly == (Assembly)null)
            {
                throw new ArgumentNullException("assembly");
            }
            if (assembly.ReflectionOnly)
            {
                throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_AsmLoadedForReflectionOnly"));
            }
            RuntimeAssembly runtimeAssembly = assembly as RuntimeAssembly;
            // ISSUE: variable of the null type
            __Null local = null;

            if ((Assembly)runtimeAssembly == (Assembly)local)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeAssembly"));
            }
            bool flag = true;

            Type[] registrableTypesInAssembly = this.GetRegistrableTypesInAssembly(assembly);
            int    length1 = registrableTypesInAssembly.Length;
            string @string = runtimeAssembly.GetVersion().ToString();

            for (int index = 0; index < length1; ++index)
            {
                this.CallUserDefinedRegistrationMethod(registrableTypesInAssembly[index], false);
                if (this.IsRegisteredAsValueType(registrableTypesInAssembly[index]))
                {
                    if (!this.UnregisterValueType(registrableTypesInAssembly[index], @string))
                    {
                        flag = false;
                    }
                }
                else if (this.TypeRepresentsComType(registrableTypesInAssembly[index]))
                {
                    if (!this.UnregisterComImportedType(registrableTypesInAssembly[index], @string))
                    {
                        flag = false;
                    }
                }
                else if (!this.UnregisterManagedType(registrableTypesInAssembly[index], @string))
                {
                    flag = false;
                }
            }
            object[] customAttributes = assembly.GetCustomAttributes(typeof(PrimaryInteropAssemblyAttribute), false);
            int      length2          = customAttributes.Length;

            if (flag)
            {
                for (int index = 0; index < length2; ++index)
                {
                    this.UnregisterPrimaryInteropAssembly(assembly, (PrimaryInteropAssemblyAttribute)customAttributes[index]);
                }
            }
            return(registrableTypesInAssembly.Length != 0 || length2 > 0);
        }
        public static Vector3 GetPointOnCircle(Vector3 center, float radius, float degrees)
        {
            double num1 = center.x + (double)radius * (double)Mathf.Cos(degrees * ((float)Math.PI / 180f));
            float  num2 = (float)(center.z + (double)radius * (double)Mathf.Sin(degrees * ((float)Math.PI / 180f)));
            // ISSUE: variable of the null type
            __Null y    = center.y;
            double num3 = (double)num2;

            return(new Vector3((float)num1, (float)y, (float)num3));
        }
Example #24
0
        internal void MarkFaultAddr(int faultAddr)
        {
            this.m_currentState = 4;
            int num = faultAddr;
            // ISSUE: variable of the null type
            __Null local = null;
            int    type  = 4;

            this.MarkHelper(num, num, (Type)local, type);
        }
    private void TrackTurret()
    {
        if (!Object.op_Inequality((Object)this.targetTurret, (Object)null))
        {
            return;
        }
        Vector3 vector3 = Vector3.op_Subtraction(this.targetTurret.get_position(), this.turret.get_position());

        ((Vector3) ref vector3).get_normalized();
        float yaw;
        float pitch;

        this.CalculateYawPitchOffset(this.turret, this.turret.get_position(), this.targetTurret.get_position(), out yaw, out pitch);
        yaw = this.NormalizeYaw(yaw);
        float num1 = Time.get_deltaTime() * this.turretTurnSpeed;

        if ((double)yaw < -0.5)
        {
            this.vecTurret.y = (__Null)((this.vecTurret.y - (double)num1) % 360.0);
        }
        else if ((double)yaw > 0.5)
        {
            this.vecTurret.y = (__Null)((this.vecTurret.y + (double)num1) % 360.0);
        }
        this.turret.set_localEulerAngles(this.vecTurret);
        float num2 = Time.get_deltaTime() * this.cannonPitchSpeed;

        this.CalculateYawPitchOffset(this.mainCannon, this.mainCannon.get_position(), this.targetTurret.get_position(), out yaw, out pitch);
        if ((double)pitch < -0.5)
        {
            this.vecMainCannon.x = (__Null)(this.vecMainCannon.x - (double)num2);
        }
        else if ((double)pitch > 0.5)
        {
            this.vecMainCannon.x = (__Null)(this.vecMainCannon.x + (double)num2);
        }
        this.vecMainCannon.x = (__Null)(double)Mathf.Clamp((float)this.vecMainCannon.x, -55f, 5f);
        this.mainCannon.set_localEulerAngles(this.vecMainCannon);
        if ((double)pitch < -0.5)
        {
            this.vecCoaxGun.x = (__Null)(this.vecCoaxGun.x - (double)num2);
        }
        else if ((double)pitch > 0.5)
        {
            this.vecCoaxGun.x = (__Null)(this.vecCoaxGun.x + (double)num2);
        }
        this.vecCoaxGun.x = (__Null)(double)Mathf.Clamp((float)this.vecCoaxGun.x, -65f, 15f);
        this.coaxGun.set_localEulerAngles(this.vecCoaxGun);
        if (this.rocketsOpen)
        {
            float num3 = Time.get_deltaTime() * this.rocketPitchSpeed;
            this.CalculateYawPitchOffset(this.rocketsPitch, this.rocketsPitch.get_position(), this.targetTurret.get_position(), out yaw, out pitch);
            if ((double)pitch < -0.5)
            {
                ref __Null local = ref this.vecRocketsPitch.x;
Example #26
0
    public static Vector3 Denormalize(Vector3 normPos)
    {
        // ISSUE: variable of the null type
        __Null local = TerrainMeta.Position.x + normPos.x * TerrainMeta.Size.x;
        float  num1  = (float)(TerrainMeta.Position.y + normPos.y * TerrainMeta.Size.y);
        float  num2  = (float)(TerrainMeta.Position.z + normPos.z * TerrainMeta.Size.z);
        double num3  = (double)num1;
        double num4  = (double)num2;

        return(new Vector3((float)local, (float)num3, (float)num4));
    }
Example #27
0
    public static Vector3 Normalize(Vector3 worldPos)
    {
        // ISSUE: variable of the null type
        __Null local = (worldPos.x - TerrainMeta.Position.x) * TerrainMeta.OneOverSize.x;
        float  num1  = (float)((worldPos.y - TerrainMeta.Position.y) * TerrainMeta.OneOverSize.y);
        float  num2  = (float)((worldPos.z - TerrainMeta.Position.z) * TerrainMeta.OneOverSize.z);
        double num3  = (double)num1;
        double num4  = (double)num2;

        return(new Vector3((float)local, (float)num3, (float)num4));
    }
    public override void Save(BaseNetworkable.SaveInfo info)
    {
        base.Save(info);
        info.msg.spinnerWheel = (__Null)Pool.Get <SpinnerWheel>();
        // ISSUE: variable of the null type
        __Null     spinnerWheel = info.msg.spinnerWheel;
        Quaternion rotation     = this.wheel.get_rotation();
        Vector3    eulerAngles  = ((Quaternion) ref rotation).get_eulerAngles();

        ((SpinnerWheel)spinnerWheel).spin = (__Null)eulerAngles;
    }
Example #29
0
        private Rectangle GetRoom(Point origin)
        {
            Point result1;
            bool  flag1 = WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Left(25), (GenCondition) new Conditions.IsSolid()), out result1);
            Point result2;
            bool  flag2 = WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Right(25), (GenCondition) new Conditions.IsSolid()), out result2);

            if (!flag1)
            {
                result1 = new Point(origin.X - 25, (int)origin.Y);
            }
            if (!flag2)
            {
                result2 = new Point(origin.X + 25, (int)origin.Y);
            }
            Rectangle rectangle;

            // ISSUE: explicit reference operation
            ((Rectangle)@rectangle).\u002Ector((int)origin.X, (int)origin.Y, 0, 0);
            if (origin.X - result1.X > result2.X - origin.X)
            {
                rectangle.X     = result1.X;
                rectangle.Width = (__Null)Utils.Clamp <int>((int)(result2.X - result1.X), 15, 30);
            }
            else
            {
                rectangle.Width = (__Null)Utils.Clamp <int>((int)(result2.X - result1.X), 15, 30);
                rectangle.X     = result2.X - rectangle.Width;
            }
            Point result3;
            bool  flag3 = WorldUtils.Find(result1, Searches.Chain((GenSearch) new Searches.Up(10), (GenCondition) new Conditions.IsSolid()), out result3);
            Point result4;
            bool  flag4 = WorldUtils.Find(result2, Searches.Chain((GenSearch) new Searches.Up(10), (GenCondition) new Conditions.IsSolid()), out result4);

            if (!flag3)
            {
                result3 = new Point((int)origin.X, origin.Y - 10);
            }
            if (!flag4)
            {
                result4 = new Point((int)origin.X, origin.Y - 10);
            }
            rectangle.Height = (__Null)Utils.Clamp <int>(Math.Max((int)(origin.Y - result3.Y), (int)(origin.Y - result4.Y)), 8, 12);
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            Rectangle& local1 = @rectangle;
            // ISSUE: explicit reference operation
            // ISSUE: variable of the null type
            __Null local2 = (^ local1).Y - rectangle.Height;

            // ISSUE: explicit reference operation
            (^ local1).Y = local2;
            return(rectangle);
        }
Example #30
0
        public JobSchedulerEventsService(CoreBusinessLayerPlugin parent)
        {
            this.parent = parent;
            JobResultsManager resultsManager = this.resultsManager;
            // ISSUE: variable of the null type
            __Null jobFailure = resultsManager.JobFailure;
            JobSchedulerEventsService schedulerEventsService = this;

            // ISSUE: virtual method pointer
            JobResultsManager.JobFailureDelegate jobFailureDelegate = new JobResultsManager.JobFailureDelegate((object)schedulerEventsService, __vmethodptr(schedulerEventsService, ProcessJobFailure));
            resultsManager.JobFailure = (__Null)Delegate.Combine((Delegate)jobFailure, (Delegate)jobFailureDelegate);
        }