コード例 #1
0
        // Token: 0x06001744 RID: 5956 RVA: 0x0006E7A0 File Offset: 0x0006C9A0
        public static bool CanAffordSpawn(GameObject prefab)
        {
            VFXAttributes component = prefab.GetComponent <VFXAttributes>();

            if (component)
            {
                int intensityScore = component.GetIntensityScore();
                int num            = VFXBudget.totalCost + intensityScore + VFXBudget.particleCostBias.value;
                switch (component.vfxPriority)
                {
                case VFXAttributes.VFXPriority.Low:
                    return(Mathf.Pow((float)VFXBudget.lowPriorityCostThreshold.value / (float)num, VFXBudget.chanceFailurePower) > UnityEngine.Random.value);

                case VFXAttributes.VFXPriority.Medium:
                    return(Mathf.Pow((float)VFXBudget.mediumPriorityCostThreshold.value / (float)num, VFXBudget.chanceFailurePower) > UnityEngine.Random.value);

                case VFXAttributes.VFXPriority.Always:
                    return(true);
                }
            }
            return(true);
        }
コード例 #2
0
        // Token: 0x0600157C RID: 5500 RVA: 0x0005BA80 File Offset: 0x00059C80
        public static bool CanAffordSpawn(VFXAttributes vfxAttributes)
        {
            if (vfxAttributes == null)
            {
                return(true);
            }
            int intensityScore = vfxAttributes.GetIntensityScore();
            int num            = VFXBudget.totalCost + intensityScore + VFXBudget.particleCostBias.value;

            switch (vfxAttributes.vfxPriority)
            {
            case VFXAttributes.VFXPriority.Low:
                return(Mathf.Pow((float)VFXBudget.lowPriorityCostThreshold.value / (float)num, VFXBudget.chanceFailurePower) > UnityEngine.Random.value);

            case VFXAttributes.VFXPriority.Medium:
                return(Mathf.Pow((float)VFXBudget.mediumPriorityCostThreshold.value / (float)num, VFXBudget.chanceFailurePower) > UnityEngine.Random.value);

            case VFXAttributes.VFXPriority.Always:
                return(true);

            default:
                return(true);
            }
        }