Пример #1
0
        void Awake()
        {
            CopyFieldHandler.UpdateFieldValues <ModPowderComponent>(this);

            PowderItem powderItem = this.GetComponent <PowderItem>();
            GearItem   gearItem   = this.GetComponent <GearItem>();

            if (powderItem && gearItem && !gearItem.m_BeenInspected && ChanceFull != 100f)
            {
                if (!RandomUtils.RollChance(ChanceFull))
                {
                    powderItem.m_WeightKG = powderItem.m_WeightLimitKG * RandomUtils.Range(0.125f, 1f);
                }
            }
        }
Пример #2
0
        void Awake()
        {
            CopyFieldHandler.UpdateFieldValues <ModStackableComponent>(this);
            GearItem      gearItem  = this.GetComponent <GearItem>();
            StackableItem stackable = gearItem?.GetComponent <StackableItem>();

            if (stackable && gearItem && !gearItem.m_BeenInspected)
            {
                if (stackable.m_UnitsPerItem == 1 || RandomUtils.RollChance(this.ChanceFull))
                {
                    stackable.m_Units = stackable.m_UnitsPerItem;
                }
                else
                {
                    stackable.m_Units = RandomUtils.Range(1, stackable.m_UnitsPerItem);
                }
            }
        }
Пример #3
0
        void Awake()
        {
            CopyFieldHandler.UpdateFieldValues <ModClothingComponent>(this);

            if (string.IsNullOrEmpty(ImplementationType))
            {
                return;
            }

            Type   implementationType = TypeResolver.Resolve(ImplementationType, true);
            object implementation     = Activator.CreateInstance(implementationType);

            if (implementation is null)
            {
                return;
            }

            Implementation = implementation;

            OnPutOn   = CreateImplementationActionDelegate("OnPutOn");
            OnTakeOff = CreateImplementationActionDelegate("OnTakeOff");
        }
Пример #4
0
 public void Start()
 {
     CopyFieldHandler.UpdateFieldValues <ChangeLayer>(this);
     this.Invoke("SetLayer", 1);
 }
Пример #5
0
 void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModFoodComponent>(this);
 }
Пример #6
0
 protected override void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModToolComponent>(this);
     base.Awake();
 }
Пример #7
0
 void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModRandomItemComponent>(this);
 }
Пример #8
0
 protected override void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModGenericEquippableComponent>(this);
     base.Awake();
 }
Пример #9
0
 void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModBodyHarvestComponent>(this);
 }