Example #1
0
    public void InitDialog(ObjectManager nameObj, TypeInit typeInit)
    {
        if (preDialog != null)
        {
            Destroy(preDialog);
            preDialog = null;
        }

        GameObject newObj = (GameObject)Instantiate(Resources.Load("Prefabs/" + nameObj.ToString()));

        newObj.transform.SetParent(gameObject.transform);
        newObj.transform.localScale = Vector3.one;
        newObj.GetComponent <RectTransform>().sizeDelta = new Vector2(widthSize, (float)Screen.height / Screen.width * widthSize);

        if (typeInit == TypeInit.Immediately)
        {
            newObj.transform.localPosition = Vector2.zero;
        }

        if (preDialog == null)
        {
            preDialog = newObj;
        }
    }
Example #2
0
    public void InitGameScene(ObjectManager nameObj, TypeInit typeInit)
    {
        if (preScene != null)
        {
            Destroy(preScene);
            preScene = null;
        }

        GameObject newObj = (GameObject)Instantiate(Resources.Load("Prefabs/" + nameObj.ToString()));

        newObj.transform.SetParent(gameObject.transform);
        newObj.transform.localScale = Vector3.one;
        newObj.GetComponent <RectTransform>().sizeDelta = new Vector2(800, 1280);

        if (typeInit == TypeInit.Immediately)
        {
            newObj.transform.localPosition = Vector2.zero;
        }

        if (preScene == null)
        {
            preScene = newObj;
        }
    }
Example #3
0
 public void BindExternalType(string name, TypeInit typeInit, TypeAssign typeAssign, TypeAsString typeAsString, TypeDelete typeDelete)
 {
     ExternalType t;
     t.name = name;
     t.typeInit = typeInit;
     t.typeAssign = typeAssign;
     t.typeAsString = typeAsString;
     t.typeDelete = typeDelete;
     externalTypes[name] = t;
 }