예제 #1
0
 protected virtual void Spawn(int numToSpawn)
 {
     numToSpawn = Mathf.Min(numToSpawn, this.maxPopulation - this.currentPopulation);
     for (int index = 0; index < numToSpawn; ++index)
     {
         Vector3        pos;
         Quaternion     rot;
         BaseSpawnPoint spawnPoint = this.GetSpawnPoint(out pos, out rot);
         if (Object.op_Implicit((Object)spawnPoint))
         {
             BaseEntity entity = GameManager.server.CreateEntity(this.GetPrefab(), pos, rot, false);
             if (Object.op_Implicit((Object)entity))
             {
                 entity.enableSaving = false;
                 ((Component)entity).get_gameObject().AwakeFromInstantiate();
                 entity.Spawn();
                 this.PostSpawnProcess(entity, spawnPoint);
                 M0 m0 = ((Component)entity).get_gameObject().AddComponent <SpawnPointInstance>();
                 ((SpawnPointInstance)m0).parentSpawnGroup = this;
                 ((SpawnPointInstance)m0).parentSpawnPoint = spawnPoint;
                 ((SpawnPointInstance)m0).Notify();
             }
         }
     }
 }
예제 #2
0
        private void RefreshButtons(QuestDifficulties difficulty)
        {
            if (Object.op_Equality((Object)null, (Object)this.BtnNormal) || Object.op_Equality((Object)null, (Object)this.BtnElite))
            {
                return;
            }
            switch (difficulty)
            {
            case QuestDifficulties.Normal:
                Button componentInChildren = (Button)this.BtnNormal.GetComponentInChildren <Button>();
                ((Selectable)this.BtnNormal.GetComponentInChildren <Button>()).set_interactable(true);
                if (!((Behaviour)componentInChildren).get_enabled())
                {
                    M0         component = this.BtnNormal.GetComponent <Image>();
                    ColorBlock colors    = ((Selectable)componentInChildren).get_colors();
                    // ISSUE: explicit reference operation
                    Color disabledColor = ((ColorBlock)@colors).get_disabledColor();
                    ((Graphic)component).set_color(disabledColor);
                    ((Behaviour)this.BtnNormal.GetComponentInChildren <Button>()).set_enabled(true);
                }
                ((Selectable)this.BtnElite.GetComponentInChildren <Button>()).set_interactable(false);
                break;

            case QuestDifficulties.Elite:
                ((Selectable)this.BtnNormal.GetComponentInChildren <Button>()).set_interactable(false);
                ((Selectable)this.BtnElite.GetComponentInChildren <Button>()).set_interactable(true);
                break;
            }
        }
예제 #3
0
    public static void Add(
        UIParticle particleSource,
        RectTransform spawnPosition,
        RectTransform particleCanvas)
    {
        M0 m0 = Object.Instantiate <GameObject>((M0)((Component)particleSource).get_gameObject());

        ((GameObject)m0).get_transform().SetParent((Transform)spawnPosition, false);
        Transform transform = ((GameObject)m0).get_transform();
        Rect      rect1     = spawnPosition.get_rect();
        double    num1      = (double)Random.Range(0.0f, ((Rect) ref rect1).get_width());
        Rect      rect2     = spawnPosition.get_rect();
        double    num2      = (double)((Rect) ref rect2).get_width() * spawnPosition.get_pivot().x;
        double    num3      = num1 - num2;
        Rect      rect3     = spawnPosition.get_rect();
        double    num4      = (double)Random.Range(0.0f, ((Rect) ref rect3).get_height());
        Rect      rect4     = spawnPosition.get_rect();
        double    num5      = (double)((Rect) ref rect4).get_height() * spawnPosition.get_pivot().y;
        double    num6      = num4 - num5;
        Vector3   vector3   = new Vector3((float)num3, (float)num6, 0.0f);

        transform.set_localPosition(vector3);
        ((GameObject)m0).get_transform().SetParent((Transform)particleCanvas, true);
        ((GameObject)m0).get_transform().set_localScale(Vector3.get_one());
        ((GameObject)m0).get_transform().set_localRotation(Quaternion.get_identity());
    }
    public GameObject CreateTerrain()
    {
        TerrainData terrainData = new TerrainData();

        terrainData.set_baseMapResolution(Mathf.NextPowerOfTwo((int)((double)World.Size * 0.00999999977648258)));
        terrainData.set_heightmapResolution(Mathf.NextPowerOfTwo((int)((double)World.Size * 0.5)) + 1);
        terrainData.set_alphamapResolution(Mathf.NextPowerOfTwo((int)((double)World.Size * 0.5)));
        terrainData.set_size(new Vector3((float)World.Size, 1000f, (float)World.Size));
        Terrain component = (Terrain)Terrain.CreateTerrainGameObject(terrainData).GetComponent <Terrain>();

        ((Component)component).get_transform().set_position(Vector3.op_Addition(((Component)this).get_transform().get_position(), new Vector3((float)-World.Size * 0.5f, 0.0f, (float)-World.Size * 0.5f)));
        component.set_castShadows(this.config.CastShadows);
        component.set_materialType((Terrain.MaterialType) 3);
        component.set_materialTemplate(this.config.Material);
        ((Component)component).get_gameObject().set_tag(((Component)this).get_gameObject().get_tag());
        ((Component)component).get_gameObject().set_layer(((Component)this).get_gameObject().get_layer());
        ((Collider)((Component)component).get_gameObject().GetComponent <TerrainCollider>()).set_sharedMaterial(this.config.GenericMaterial);
        M0 m0 = ((Component)component).get_gameObject().AddComponent <TerrainMeta>();

        ((Component)component).get_gameObject().AddComponent <TerrainPhysics>();
        ((Component)component).get_gameObject().AddComponent <TerrainColors>();
        ((Component)component).get_gameObject().AddComponent <TerrainCollision>();
        ((Component)component).get_gameObject().AddComponent <TerrainBiomeMap>();
        ((Component)component).get_gameObject().AddComponent <TerrainAlphaMap>();
        ((Component)component).get_gameObject().AddComponent <TerrainHeightMap>();
        ((Component)component).get_gameObject().AddComponent <TerrainSplatMap>();
        ((Component)component).get_gameObject().AddComponent <TerrainTopologyMap>();
        ((Component)component).get_gameObject().AddComponent <TerrainWaterMap>();
        ((Component)component).get_gameObject().AddComponent <TerrainPath>();
        ((TerrainMeta)m0).terrain = component;
        ((TerrainMeta)m0).config  = this.config;
        Object.DestroyImmediate((Object)((Component)this).get_gameObject());
        return(((Component)component).get_gameObject());
    }
예제 #5
0
 protected override void AttributeSetup(
     GameObject rootObj,
     string name,
     bool serverside,
     bool clientside,
     bool bundling)
 {
     base.AttributeSetup(rootObj, name, serverside, clientside, bundling);
     if (!clientside)
     {
         return;
     }
     if (this.renderer)
     {
         M0           component1 = rootObj.GetComponent <MeshFilter>();
         MeshRenderer component2 = (MeshRenderer)rootObj.GetComponent <MeshRenderer>();
         if (!Object.op_Implicit((Object)component1))
         {
             ((MeshFilter)rootObj.AddComponent <MeshFilter>()).set_sharedMesh(this.mesh);
         }
         if (!Object.op_Implicit((Object)component2))
         {
             MeshRenderer meshRenderer = (MeshRenderer)rootObj.AddComponent <MeshRenderer>();
             ((Renderer)meshRenderer).set_sharedMaterial(this.material);
             ((Renderer)meshRenderer).set_shadowCastingMode((ShadowCastingMode)0);
         }
     }
     if (!this.collider || Object.op_Implicit((Object)rootObj.GetComponent <MeshCollider>()))
     {
         return;
     }
     ((MeshCollider)rootObj.AddComponent <MeshCollider>()).set_sharedMesh(this.mesh);
 }
예제 #6
0
    protected void OnEnable()
    {
        M0 component = ((Component)this).GetComponent <Camera>();

        float[] layerCullDistances = ((Camera)component).get_layerCullDistances();
        layerCullDistances[LayerMask.NameToLayer(this.Layer)] = this.Distance;
        ((Camera)component).set_layerCullDistances(layerCullDistances);
    }
예제 #7
0
 private void Start()
 {
     for (int index = 0; index < this.amount; ++index)
     {
         M0 m0 = Object.Instantiate <GameObject>((M0)this.source);
         ((GameObject)m0).get_transform().set_position(Vector3.op_Addition(((Component)this).get_transform().get_position(), Vector3Ex.Range(-this.radius, this.radius)));
         ((Object)m0).set_hideFlags((HideFlags)3);
     }
 }
예제 #8
0
    private ColliderGroup CreateColliderGroup(
        ColliderGrid grid,
        ColliderCell cell,
        ColliderKey key)
    {
        M0 m0 = Pool.Get <ColliderGroup>();

        ((ColliderGroup)m0).Initialize(grid, cell, key);
        return((ColliderGroup)m0);
    }
        public override void HandleError(RefreshTokenException exception)
        {
            IProfileDataService profileDataService = (IProfileDataService)Mvx.get_IoCProvider().Resolve <IProfileDataService>();
            M0 m0 = Mvx.get_IoCProvider().Resolve <IMvxMessenger>();

            profileDataService.DeleteOnlyProfileData(exception.Profile);
            LoginRequiredMessage loginRequiredMessage = new LoginRequiredMessage((object)this, exception.Profile);

            ((IMvxMessenger)m0).Publish <LoginRequiredMessage>((M0)loginRequiredMessage);
        }
예제 #10
0
        public override ProfileBase DeepCopy()
        {
            M0 m0 = JsonConvert.DeserializeObject <D2Profile>(JsonConvert.SerializeObject((object)this));

            ((D2Profile)m0).CurrentKey = (CDKey)null;
            ((ProfileBase)m0).Status   = Status.Stop;
            ((ProfileBase)m0).State    = "";
            ((D2Profile)m0).D2Process  = (Process)null;
            return((ProfileBase)m0);
        }
    public void Setup(Barricade t)
    {
        this.target = t;
        ((Component)this).get_transform().SetParent(((Component)this.target).get_transform(), false);
        ((Component)this).get_gameObject().set_layer(18);
        M0 m0 = ((Component)this).get_gameObject().AddComponent <BoxCollider>();

        ((Collider)m0).set_isTrigger(true);
        ((BoxCollider)m0).set_center(Vector3.get_zero());
        ((BoxCollider)m0).set_size(Vector3.op_Addition(Vector3.op_Multiply(Vector3.get_one(), AI.npc_door_trigger_size), Vector3.op_Multiply(Vector3.get_right(), (float)((Bounds) ref this.target.bounds).get_size().x)));
    }
    public void Setup(Door d)
    {
        this.door = d;
        ((Component)this).get_transform().SetParent(((Component)this.door).get_transform(), false);
        ((Component)this).get_gameObject().set_layer(18);
        M0 m0 = ((Component)this).get_gameObject().AddComponent <BoxCollider>();

        ((Collider)m0).set_isTrigger(true);
        ((BoxCollider)m0).set_center(Vector3.get_zero());
        ((BoxCollider)m0).set_size(Vector3.op_Multiply(Vector3.get_one(), AI.npc_door_trigger_size));
    }
예제 #13
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = M0.GetHashCode();
         hashCode = (hashCode * 397) ^ M1.GetHashCode();
         hashCode = (hashCode * 397) ^ M2.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Pos;
         return(hashCode);
     }
 }
예제 #14
0
 private void OnPreCull()
 {
     if (Application.get_isPlaying())
     {
         M0 component = ((Component)this).GetComponent <Camera>();
         ((Camera)component).set_cullingMask(((Camera)component).get_cullingMask() & ~(1 << GameUtility.LayerHidden));
     }
     if (CameraHook.mPreCullEventListeners == null)
     {
         return;
     }
     CameraHook.mPreCullEventListeners((Camera)((Component)this).GetComponent <Camera>());
 }
예제 #15
0
    private Rigidbody SetupRigidBody()
    {
        if (this.isServer)
        {
            GameObject prefab = this.gameManager.FindPrefab(this.prefabRagdoll.resourcePath);
            if (Object.op_Equality((Object)prefab, (Object)null))
            {
                return((Rigidbody)null);
            }
            Ragdoll component1 = (Ragdoll)prefab.GetComponent <Ragdoll>();
            if (Object.op_Equality((Object)component1, (Object)null))
            {
                return((Rigidbody)null);
            }
            if (Object.op_Equality((Object)component1.primaryBody, (Object)null))
            {
                Debug.LogError((object)("[BaseCorpse] ragdoll.primaryBody isn't set!" + ((Object)((Component)component1).get_gameObject()).get_name()));
                return((Rigidbody)null);
            }
            BoxCollider component2 = (BoxCollider)((Component)component1.primaryBody).GetComponent <BoxCollider>();
            if (Object.op_Equality((Object)component2, (Object)null))
            {
                Debug.LogError((object)"Ragdoll has unsupported primary collider (make it supported) ", (Object)component1);
                return((Rigidbody)null);
            }
            M0 m0 = ((Component)this).get_gameObject().AddComponent <BoxCollider>();
            ((BoxCollider)m0).set_size(Vector3.op_Multiply(component2.get_size(), 2f));
            ((BoxCollider)m0).set_center(component2.get_center());
            ((Collider)m0).set_sharedMaterial(((Collider)component2).get_sharedMaterial());
        }
        Rigidbody rigidBody = (Rigidbody)((Component)this).get_gameObject().GetComponent <Rigidbody>();

        if (Object.op_Equality((Object)rigidBody, (Object)null))
        {
            rigidBody = (Rigidbody)((Component)this).get_gameObject().AddComponent <Rigidbody>();
        }
        rigidBody.set_mass(10f);
        rigidBody.set_useGravity(true);
        rigidBody.set_drag(0.5f);
        rigidBody.set_collisionDetectionMode((CollisionDetectionMode)0);
        if (this.isServer)
        {
            Buoyancy component = (Buoyancy)((Component)this).GetComponent <Buoyancy>();
            if (Object.op_Inequality((Object)component, (Object)null))
            {
                component.rigidBody = rigidBody;
            }
            Physics.ApplyDropped(rigidBody);
            Vector3    vector3 = Vector3Ex.Range(-1f, 1f);
            ref __Null local   = ref vector3.y;
        public override void HandleError(ServerUnreachableException exception)
        {
            IAuthDataService    authDataService    = (IAuthDataService)Mvx.get_IoCProvider().Resolve <IAuthDataService>();
            IProfileDataService profileDataService = (IProfileDataService)Mvx.get_IoCProvider().Resolve <IProfileDataService>();
            M0 m0 = Mvx.get_IoCProvider().Resolve <IConnectivity>();
            ICredentialsDataService credentialsDataService = (ICredentialsDataService)Mvx.get_IoCProvider().Resolve <ICredentialsDataService>();

            if (((IConnectivity)m0).get_IsConnected())
            {
                Profile profile = profileDataService.GetActiveProfile();
                try
                {
                    if (profile == null)
                    {
                        this.DisplayServerUnreachableErrorMessage(exception);
                    }
                    else
                    {
                        Credentials credentials = credentialsDataService.GetCredentials(profile?.Id);
                        if (credentials != null)
                        {
                            Task.Run <Profile>((Func <Task <Profile> >)(() => authDataService.Login(profile.Institute, credentials.UserName, credentials.Password))).Wait();
                        }
                        else
                        {
                            Task.Run <TokenData>((Func <Task <TokenData> >)(() => authDataService.RefreshToken(profile))).Wait();
                        }
                    }
                }
                catch (AggregateException ex)
                {
                    foreach (Exception innerException in ex.Flatten().InnerExceptions)
                    {
                        if (innerException is ServerUnreachableException exception1)
                        {
                            this.DisplayServerUnreachableErrorMessage(exception1);
                            ErrorHandler.Current.HandleError((Exception) new RefreshTokenException("Sikertelen relogin vagy token refresh", profile).SetErrorCode <RefreshTokenException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/Helpers/ErrorHandlers/ServerUnreachableErrorHandler.cs", 58));
                        }
                        else
                        {
                            ErrorHandler.Current.HandleError(innerException);
                        }
                    }
                }
            }
            else
            {
                ErrorHandler.Current.HandleError((Exception) new NoInternetConnectionException().SetErrorCode <NoInternetConnectionException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/Helpers/ErrorHandlers/ServerUnreachableErrorHandler.cs", 69));
            }
        }
예제 #17
0
 internal static void Process(GameObject go, bool IsFemale)
 {
     if (!IsFemale)
     {
         return;
     }
     foreach (MeshReplacement componentsInChild in (MeshReplacement[])go.GetComponentsInChildren <MeshReplacement>(true))
     {
         M0 component = ((Component)componentsInChild).GetComponent <SkinnedMeshRenderer>();
         ((SkinnedMeshRenderer)component).set_sharedMesh(componentsInChild.Female.get_sharedMesh());
         ((SkinnedMeshRenderer)component).set_rootBone(componentsInChild.Female.get_rootBone());
         ((SkinnedMeshRenderer)component).set_bones(componentsInChild.Female.get_bones());
     }
 }
예제 #18
0
        private void RefreshButtons(QuestDifficulties difficulty)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object)null, (UnityEngine.Object) this.BtnNormal) || UnityEngine.Object.op_Equality((UnityEngine.Object)null, (UnityEngine.Object) this.BtnElite) || UnityEngine.Object.op_Equality((UnityEngine.Object)null, (UnityEngine.Object) this.BtnExtra))
            {
                return;
            }
            this.BtnNormal.SetActive(true);
            this.BtnElite.SetActive(true);
            switch (difficulty)
            {
            case QuestDifficulties.Normal:
                this.BtnUnitRanking.SetActive(true);
                this.BtnEliteBookmark.SetActive(false);
                ((Selectable)this.BtnNormal.GetComponent <Button>()).set_interactable(false);
                ((Behaviour)this.BtnNormal.GetComponent <Button>()).set_enabled(false);
                M0         component1 = this.BtnNormal.GetComponent <Image>();
                ColorBlock colors1    = ((Selectable)this.BtnNormal.GetComponent <Button>()).get_colors();
                // ISSUE: explicit reference operation
                Color normalColor1 = ((ColorBlock)@colors1).get_normalColor();
                ((Graphic)component1).set_color(normalColor1);
                ((Selectable)this.BtnElite.GetComponent <Button>()).set_interactable(true);
                ((Behaviour)this.BtnElite.GetComponent <Button>()).set_enabled(true);
                M0         component2 = this.BtnElite.GetComponent <Image>();
                ColorBlock colors2    = ((Selectable)this.BtnElite.GetComponent <Button>()).get_colors();
                // ISSUE: explicit reference operation
                Color pressedColor1 = ((ColorBlock)@colors2).get_pressedColor();
                ((Graphic)component2).set_color(pressedColor1);
                break;

            case QuestDifficulties.Elite:
                this.BtnUnitRanking.SetActive(false);
                this.BtnEliteBookmark.SetActive(true);
                ((Selectable)this.BtnNormal.GetComponentInChildren <Button>()).set_interactable(true);
                ((Behaviour)this.BtnNormal.GetComponentInChildren <Button>()).set_enabled(true);
                M0         component3 = this.BtnNormal.GetComponent <Image>();
                ColorBlock colors3    = ((Selectable)this.BtnNormal.GetComponent <Button>()).get_colors();
                // ISSUE: explicit reference operation
                Color pressedColor2 = ((ColorBlock)@colors3).get_pressedColor();
                ((Graphic)component3).set_color(pressedColor2);
                ((Selectable)this.BtnElite.GetComponentInChildren <Button>()).set_interactable(false);
                ((Behaviour)this.BtnElite.GetComponentInChildren <Button>()).set_enabled(false);
                M0         component4 = this.BtnElite.GetComponent <Image>();
                ColorBlock colors4    = ((Selectable)this.BtnElite.GetComponent <Button>()).get_colors();
                // ISSUE: explicit reference operation
                Color normalColor2 = ((ColorBlock)@colors4).get_normalColor();
                ((Graphic)component4).set_color(normalColor2);
                break;
            }
        }
    public void SpawnScientist(Vector3 spawnPos)
    {
        Quaternion identity  = Quaternion.get_identity();
        M0         component = ((Component)GameManager.server.CreateEntity(this.scientistPrefab.resourcePath, spawnPos, identity, true)).GetComponent <NPCPlayerApex>();

        ((BaseNetworkable)component).Spawn();
        ((NPCPlayerApex)component).Mount((BaseMountable)this);
        ((NPCPlayerApex)component).Stats.VisionRange            = 203f;
        ((NPCPlayerApex)component).Stats.DeaggroRange           = 202f;
        ((NPCPlayerApex)component).Stats.AggressionRange        = 201f;
        ((NPCPlayerApex)component).Stats.LongRange              = 200f;
        ((NPCPlayerApex)component).Stats.Hostility              = 0.0f;
        ((NPCPlayerApex)component).Stats.Defensiveness          = 0.0f;
        ((NPCPlayerApex)component).Stats.OnlyAggroMarkedTargets = true;
        ((NPCPlayerApex)component).InitFacts();
    }
예제 #20
0
 private void Update()
 {
     if (!this.inited && this.sourceClip.get_loadState() == 2)
     {
         this.sampleRate      = this.sourceClip.get_frequency();
         this.sourceAudioData = new float[this.sourceClip.get_samples() * this.sourceClip.get_channels()];
         this.sourceClip.GetData(this.sourceAudioData, 0);
         this.InitAudioClip();
         M0 component = ((Component)this).GetComponent <AudioSource>();
         ((AudioSource)component).set_clip(this.granularClip);
         ((AudioSource)component).set_loop(true);
         ((AudioSource)component).Play();
         this.inited = true;
     }
     this.RefreshCachedData();
 }
예제 #21
0
    public override void PostInitShared()
    {
        base.PostInitShared();
        GameObject go = this.item == null || !this.item.info.worldModelPrefab.isValid ? (GameObject)Object.Instantiate <GameObject>((M0)this.itemModel) : this.item.info.worldModelPrefab.Instantiate((Transform)null);

        go.get_transform().SetParent(((Component)this).get_transform(), false);
        go.get_transform().set_localPosition(Vector3.get_zero());
        go.get_transform().set_localRotation(Quaternion.get_identity());
        go.SetLayerRecursive(((Component)this).get_gameObject().get_layer());
        Collider component1 = (Collider)go.GetComponent <Collider>();

        if (Object.op_Implicit((Object)component1))
        {
            component1.set_enabled(false);
            component1.set_enabled(true);
        }
        if (this.isServer)
        {
            WorldModel component2 = (WorldModel)go.GetComponent <WorldModel>();
            float      num1       = Object.op_Implicit((Object)component2) ? component2.mass : 1f;
            float      num2       = 0.1f;
            float      num3       = 0.1f;
            M0         m0         = ((Component)this).get_gameObject().AddComponent <Rigidbody>();
            ((Rigidbody)m0).set_mass(num1);
            ((Rigidbody)m0).set_drag(num2);
            ((Rigidbody)m0).set_angularDrag(num3);
            ((Rigidbody)m0).set_interpolation((RigidbodyInterpolation)0);
            Physics.ApplyDropped((Rigidbody)m0);
            foreach (Renderer componentsInChild in (Renderer[])go.GetComponentsInChildren <Renderer>(true))
            {
                componentsInChild.set_enabled(false);
            }
        }
        if (this.item != null)
        {
            PhysicsEffects component2 = (PhysicsEffects)((Component)this).get_gameObject().GetComponent <PhysicsEffects>();
            if (Object.op_Inequality((Object)component2, (Object)null))
            {
                component2.entity = (BaseEntity)this;
                if (Object.op_Inequality((Object)this.item.info.physImpactSoundDef, (Object)null))
                {
                    component2.physImpactSoundDef = this.item.info.physImpactSoundDef;
                }
            }
        }
        go.SetActive(true);
    }
예제 #22
0
        public void Refresh(QuestDifficulties difficulty)
        {
            this.RefreshQuests();
            if (difficulty == QuestDifficulties.Elite && this.CountQuests(QuestDifficulties.Elite) <= 0)
            {
                difficulty = QuestDifficulties.Normal;
            }
            this.mDifficultyFilter     = difficulty;
            GlobalVars.QuestDifficulty = difficulty;
            this.isTriggeredRefresh    = true;
            this.RefreshItems();
            if (Object.op_Inequality((Object)this.ScrollRect, (Object)null))
            {
                this.ScrollRect.set_normalizedPosition(Vector2.get_one());
                if (HomeWindow.GetRestorePoint() == RestorePoints.QuestList && !string.IsNullOrEmpty(GlobalVars.LastPlayedQuest.Get()) && ((QuestStates)GlobalVars.LastQuestState == QuestStates.Cleared && QuestListV2.mScrollPosCache.ContainsKey(this.ListID)))
                {
                    this.mSetScrollPos = 2;
                    this.mNewScrollPos = QuestListV2.mScrollPosCache[this.ListID];
                    QuestListV2.mScrollPosCache.Remove(this.ListID);
                    HomeWindow.SetRestorePoint(RestorePoints.Home);
                }
            }
            this.RefreshButtons(difficulty);
            if (Object.op_Inequality((Object)this.BtnElite, (Object)null))
            {
                this.BtnElite.SetActive(true);
            }
            if (!Object.op_Inequality((Object)this.BtnNormal, (Object)null))
            {
                return;
            }
            this.BtnNormal.SetActive(true);
            if (this.mQuests.Count <= 0 || this.CountQuests(QuestDifficulties.Elite) > 0)
            {
                return;
            }
            ((Selectable)this.BtnNormal.GetComponentInChildren <Button>()).set_interactable(false);
            ((Behaviour)this.BtnNormal.GetComponentInChildren <Button>()).set_enabled(false);
            M0         componentInChildren = this.BtnNormal.GetComponentInChildren <Image>();
            ColorBlock colors = ((Selectable)this.BtnNormal.GetComponentInChildren <Button>()).get_colors();
            // ISSUE: explicit reference operation
            Color normalColor = ((ColorBlock)@colors).get_normalColor();

            ((Graphic)componentInChildren).set_color(normalColor);
        }
예제 #23
0
        public ParticleSystem NewVolumetricDustParticles()
        {
            if (!Object.op_Implicit((Object)this.dustParticlesPrefab))
            {
                if (Application.get_isPlaying())
                {
                    Debug.LogError((object)"Failed to instantiate VolumetricDustParticles prefab.");
                }
                return((ParticleSystem)null);
            }
            M0 m0 = Object.Instantiate <ParticleSystem>((M0)this.dustParticlesPrefab);

            ((ParticleSystem)m0).set_useAutoRandomSeed(false);
            ((Object)m0).set_name("Dust Particles");
            ((Object)((Component)m0).get_gameObject()).set_hideFlags(Consts.ProceduralObjectsHideFlags);
            ((Component)m0).get_gameObject().SetActive(true);
            return((ParticleSystem)m0);
        }
예제 #24
0
 public void UpdateVisibleItems(ItemContainer msg)
 {
     for (int index = 0; index < this.displayModels.Length; ++index)
     {
         VisualStorageContainer.DisplayModel displayModel = this.displayModels[index];
         if (displayModel != null)
         {
             Object.Destroy((Object)displayModel.displayModel);
             this.displayModels[index] = (VisualStorageContainer.DisplayModel)null;
         }
     }
     if (msg == null)
     {
         return;
     }
     using (List <Item> .Enumerator enumerator = ((List <Item>)msg.contents).GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             Item           current        = enumerator.Current;
             ItemDefinition itemDefinition = ItemManager.FindItemDefinition((int)current.itemid);
             GameObject     gameObject     = itemDefinition.worldModelPrefab == null || !itemDefinition.worldModelPrefab.isValid ? (GameObject)Object.Instantiate <GameObject>((M0)this.defaultDisplayModel) : itemDefinition.worldModelPrefab.Instantiate((Transform)null);
             if (Object.op_Implicit((Object)gameObject))
             {
                 gameObject.get_transform().set_position(Vector3.op_Addition(((Component)this.displayNodes[current.slot]).get_transform().get_position(), new Vector3(0.0f, 0.25f, 0.0f)));
                 gameObject.get_transform().set_rotation(((Component)this.displayNodes[current.slot]).get_transform().get_rotation());
                 M0 m0 = gameObject.AddComponent <Rigidbody>();
                 ((Rigidbody)m0).set_mass(1f);
                 ((Rigidbody)m0).set_drag(0.1f);
                 ((Rigidbody)m0).set_angularDrag(0.1f);
                 ((Rigidbody)m0).set_interpolation((RigidbodyInterpolation)1);
                 ((Rigidbody)m0).set_constraints((RigidbodyConstraints)10);
                 this.displayModels[current.slot].displayModel = gameObject;
                 this.displayModels[current.slot].slot         = (int)current.slot;
                 this.displayModels[current.slot].def          = itemDefinition;
                 gameObject.SetActive(true);
             }
         }
     }
     this.SetItemsVisible(false);
     this.CancelInvoke(new Action(this.ItemUpdateComplete));
     this.Invoke(new Action(this.ItemUpdateComplete), 1f);
 }
 public override void Process(uint seed)
 {
     foreach (PathList road in TerrainMeta.Path.Roads)
     {
         using (List <Mesh> .Enumerator enumerator = road.CreateMesh().GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Mesh       current    = enumerator.Current;
                 GameObject gameObject = new GameObject("Road Mesh");
                 M0         m0         = gameObject.AddComponent <MeshCollider>();
                 ((Collider)m0).set_sharedMaterial(this.RoadPhysicMaterial);
                 ((MeshCollider)m0).set_sharedMesh(current);
                 gameObject.AddComponent <AddToHeightMap>();
                 gameObject.set_layer(16);
                 gameObject.SetHierarchyGroup(road.Name, true, false);
             }
         }
     }
 }
예제 #26
0
        public static UIMultiStateButton AddToggle(
            UIComponent optionPanel,
            string name,
            string spriteImage,
            int x,
            int y,
            int width,
            int height,
            string[] iconNames)
        {
            M0 m0 = optionPanel.AddUIComponent <UIMultiStateButton>();

            UIUtils.SetButtonPositionAndSize((UIMultiStateButton)m0, x, y, width, height);
            ((UIComponent)m0).set_playAudioEvents(true);
            ((Object)m0).set_name(name);
            ((UIComponent)m0).set_tooltip("");
            ((UIComponent)m0).set_isTooltipLocalized(false);
            ((UIMultiStateButton)m0).set_spritePadding(new RectOffset());
            ((UIMultiStateButton)m0).set_atlas(UIUtils.CreateTextureAtlas(spriteImage, name + "Atlas", ((UIPanel)optionPanel).get_atlas().get_material(), width, height, iconNames));
            return((UIMultiStateButton)m0);
        }
예제 #27
0
 protected bool CheckSupport(bool needDepth)
 {
     this.isSupported        = true;
     this.supportHDRTextures = SystemInfo.SupportsRenderTextureFormat((RenderTextureFormat)2);
     this.supportDX11        = SystemInfo.get_graphicsShaderLevel() >= 50 && SystemInfo.get_supportsComputeShaders();
     if (!SystemInfo.get_supportsImageEffects())
     {
         this.NotSupported();
         return(false);
     }
     if (needDepth && !SystemInfo.SupportsRenderTextureFormat((RenderTextureFormat)1))
     {
         this.NotSupported();
         return(false);
     }
     if (needDepth)
     {
         M0 component = ((Component)this).GetComponent <Camera>();
         ((Camera)component).set_depthTextureMode((DepthTextureMode)(((Camera)component).get_depthTextureMode() | 1));
     }
     return(true);
 }
 public override void Process(uint seed)
 {
     foreach (PathList river in TerrainMeta.Path.Rivers)
     {
         using (List <Mesh> .Enumerator enumerator = river.CreateMesh().GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Mesh       current    = enumerator.Current;
                 GameObject gameObject = new GameObject("River Mesh");
                 M0         m0         = gameObject.AddComponent <MeshCollider>();
                 ((Collider)m0).set_sharedMaterial(this.RiverPhysicMaterial);
                 ((MeshCollider)m0).set_sharedMesh(current);
                 gameObject.AddComponent <RiverInfo>();
                 gameObject.AddComponent <WaterBody>();
                 gameObject.AddComponent <AddToWaterMap>();
                 gameObject.set_tag("River");
                 gameObject.set_layer(4);
                 gameObject.SetHierarchyGroup(river.Name, true, false);
             }
         }
     }
 }
        private void UpdateSelectedChildren()
        {
            if (GlobalVars.SelectedMultiPlayArea == null)
            {
                return;
            }
            Transform transform = ((Component)this).get_transform();

            for (int index = transform.get_childCount() - 1; index >= 0; --index)
            {
                Transform child = transform.GetChild(index);
                if (!Object.op_Equality((Object)child, (Object)null))
                {
                    ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(((Component)child).get_gameObject(), (ChapterParam)null);
                    if (dataOfClass != null)
                    {
                        if (dataOfClass.iname != GlobalVars.SelectedMultiPlayArea)
                        {
                            M0         componentInChildren = ((Component)child).GetComponentInChildren <Image>();
                            ColorBlock colors = ((Selectable)((Component)child).GetComponentInChildren <Button>()).get_colors();
                            // ISSUE: explicit reference operation
                            Color disabledColor = ((ColorBlock)@colors).get_disabledColor();
                            ((Graphic)componentInChildren).set_color(disabledColor);
                        }
                        else
                        {
                            M0         componentInChildren = ((Component)child).GetComponentInChildren <Image>();
                            ColorBlock colors = ((Selectable)((Component)child).GetComponentInChildren <Button>()).get_colors();
                            // ISSUE: explicit reference operation
                            Color normalColor = ((ColorBlock)@colors).get_normalColor();
                            ((Graphic)componentInChildren).set_color(normalColor);
                        }
                    }
                }
            }
        }
예제 #30
0
 private void SwitchItemCategory(ItemDefinition[] defs)
 {
     for (int index = 0; index < this.itemButton.get_transform().get_parent().get_childCount(); ++index)
     {
         Transform child = this.itemButton.get_transform().get_parent().GetChild(index);
         if (!Object.op_Equality((Object)child, (Object)this.itemButton.get_transform()))
         {
             GameManager.Destroy(((Component)child).get_gameObject(), 0.0f);
         }
     }
     this.itemButton.SetActive(true);
     foreach (ItemDefinition itemDefinition in (IEnumerable <ItemDefinition>)((IEnumerable <ItemDefinition>)defs).OrderBy <ItemDefinition, string>((Func <ItemDefinition, string>)(x => x.displayName.translated)))
     {
         if (!itemDefinition.hidden)
         {
             M0 m0 = Object.Instantiate <GameObject>((M0)this.itemButton);
             ((GameObject)m0).get_transform().SetParent(this.itemButton.get_transform().get_parent(), false);
             ((Text)((GameObject)m0).GetComponentInChildren <Text>()).set_text(itemDefinition.displayName.translated);
             ((ItemButtonTools)((GameObject)m0).GetComponentInChildren <ItemButtonTools>()).itemDef = itemDefinition;
             ((ItemButtonTools)((GameObject)m0).GetComponentInChildren <ItemButtonTools>()).image.set_sprite(itemDefinition.iconSprite);
         }
     }
     this.itemButton.SetActive(false);
 }