Exemple #1
0
		private static void Initialize(GameManager gameManager)
		{
			if (initialized || gameManager is null) return;
			else
			{
				gameManagerObjectPrefab = new GameObject();
				Object.DontDestroyOnLoad(gameManagerObjectPrefab);
				gameManagerObjectPrefab.SetActive(false);
				gameManagerObjectPrefab.name = gameManager.name;

				CopyFieldHandler.CopyFieldsIl2Cpp(gameManagerObjectPrefab.AddComponent<GameManager>(), gameManager);
				initialized = true;
			}
		}
        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);
                }
            }
        }
Exemple #3
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);
                }
            }
        }
        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");
        }
Exemple #5
0
 public void Start()
 {
     CopyFieldHandler.UpdateFieldValues <ChangeLayer>(this);
     this.Invoke("SetLayer", 1);
 }
Exemple #6
0
 void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModFoodComponent>(this);
 }
Exemple #7
0
 protected override void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModToolComponent>(this);
     base.Awake();
 }
 void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModRandomItemComponent>(this);
 }
Exemple #9
0
 protected override void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModGenericEquippableComponent>(this);
     base.Awake();
 }
Exemple #10
0
 void Awake()
 {
     CopyFieldHandler.UpdateFieldValues <ModBodyHarvestComponent>(this);
 }