示例#1
0
        internal static Texture2D GetReloadTexture(ReloadParams reloadParams)
        {
            if (!cachedBarTextures.ContainsKey(reloadParams))
            {
                ITextureJob tex = TexturesCore.GenerateBarTextureBatch(512, 64, true, 8, 5, new Color(0f, 0f, 0f, 0.7f), barBackgroundColor, 2,
                                                                       (reloadParams.perfectStart, reloadParams.perfectEnd, barPerfectColor),
                                                                       (reloadParams.goodStart, reloadParams.goodEnd, barGoodColor)
                                                                       );

                cachedBarTextures[reloadParams] = tex.OutputTextureAndDispose();
            }
            return(cachedBarTextures[reloadParams]);
        }
 internal SniperPrimaryInstanceData(
     SniperReloadableFireSkillDef def,
     EntityStateMachine reloadTargetStatemachine,
     ReloadParams reloadParams,
     GenericSkill skillSlot
     )
 {
     this.def = def;
     this.reloadStatemachine = reloadTargetStatemachine;
     this.reloadParams       = reloadParams;
     _ = ReloadUIController.GetReloadTexture(this.reloadParams);
     this.secondarySlot     = this.reloadStatemachine.commonComponents.characterBody.skillLocator.secondary;
     this.isReloading       = true;
     this.currentReloadTier = ReloadTier.Perfect;
     this.skillSlot         = skillSlot;
     this.skillSlot.stock   = this.def.stockToReload;
     this.body = this.skillSlot.characterBody as SniperCharacterBody;
     this.body.CheckIn(this);
 }