Пример #1
0
        private void OnUnassigned_On(HooksCore.RoR2.Skills.LunarPrimaryReplacementSkill.OnUnassigned.Orig orig, LunarPrimaryReplacementSkill self, GenericSkill skillSlot)
        {
            orig(self, skillSlot);

            if (this.origCrosshairLookup.ContainsKey(self))
            {
                VisionsContextData data = this.origCrosshairLookup[self];
                if (data.origCrosshair != null)
                {
                    GameObject crosshair = skillSlot.characterBody.crosshairPrefab;
                    if (crosshair.name == this.newVisionsCrosshair.name)
                    {
                        skillSlot.characterBody.crosshairPrefab = data.origCrosshair;
                    }
                    else
                    {
                        _ = skillSlot.StartCoroutine(this.CheckCrosshairUnset(skillSlot.characterBody, data));
                    }
                }
                if (data.checkCoroutine != null)
                {
                    skillSlot.StopCoroutine(data.checkCoroutine);
                }
            }
        }
Пример #2
0
        private SkillDef.BaseSkillInstanceData OnAssigned_On1(HooksCore.RoR2.Skills.LunarPrimaryReplacementSkill.OnAssigned.Orig orig, LunarPrimaryReplacementSkill self, GenericSkill skillSlot)
        {
            SkillDef.BaseSkillInstanceData ret = orig(self, skillSlot);

            GameObject crosshair = skillSlot.characterBody.crosshairPrefab;

            if (crosshair != null)
            {
                if (!this.origCrosshairLookup.ContainsKey(self) || this.origCrosshairLookup[self] == null)
                {
                    this.origCrosshairLookup[self] = new VisionsContextData();
                }
                if (this.badCrosshairs.Contains(crosshair.name) && skillSlot.characterBody.crosshairPrefab != this.newVisionsCrosshair)
                {
                    this.origCrosshairLookup[self].origCrosshair = crosshair;
                    skillSlot.characterBody.crosshairPrefab      = this.newVisionsCrosshair;
                }
                else
                {
                    this.origCrosshairLookup[self].checkCoroutine = skillSlot.StartCoroutine(this.CheckCrosshairSet(skillSlot.characterBody, this.origCrosshairLookup[self]));
                }
            }
            return(ret);
        }