Esempio n. 1
0
        public static void InitializePickup(VRC_Pickup pickup)
        {
            if (pickup.gameObject.GetComponent <CyanEmuPickupHelper>() != null)
            {
                pickup.LogWarning("Multiple VRC_Pickup components on the same gameobject! " + VRC.Tools.GetGameObjectPath(pickup.gameObject));
                return;
            }

            CyanEmuPickupHelper helper = pickup.gameObject.AddComponent <CyanEmuPickupHelper>();

            helper.SetPickup(pickup);
        }
Esempio n. 2
0
        public static void InitializePickup(VRC_Pickup pickup)
        {
            CyanEmuPickupHelper previousHelper = pickup.gameObject.GetComponent <CyanEmuPickupHelper>();

            if (previousHelper != null)
            {
                DestroyImmediate(previousHelper);
                pickup.LogWarning("Destroying old pickup helper on object: " + VRC.Tools.GetGameObjectPath(pickup.gameObject));
            }

            CyanEmuPickupHelper helper = pickup.gameObject.AddComponent <CyanEmuPickupHelper>();

            helper.SetPickup(pickup);
        }