Beispiel #1
0
    public void AttachPart(string Name)
    {
        ModPart part = ModSystemTools.GetPartN(Name);

        if (part == null)
        {
            return;
        }
        foreach (var item in transform.GetComponentsInChildren <ModSlot>())
        {
            if (item.Type == part.Type)
            {
                if (item.installedPart != null)
                {
                    Destroy(item.installedPart.gameObject);
                }
                GameObject gm = Instantiate(part.gameObject, item.transform);
                item.installedPart = gm.GetComponent <ModPart>();
                if (item.gameObject.GetComponent <IModSystemSlot>() != null)
                {
                    item.gameObject.GetComponent <IModSystemSlot>().PartAdded(part.Type, Name);
                }
            }
        }
    }
Beispiel #2
0
    async void Start()
    {
        cam = Camera.main;
        ModSystemTools.GetPartN("Wheel");
#if UNITY_ANDROID
        Application.targetFrameRate = 60;
        QualitySettings.vSyncCount  = 0;
#endif
        gm = this;
        try
        {
            ReturnToMenu();
        }
        catch (Exception e)
        {
            Debug.Log($"gm, {e.Message}");
        }
    }