Exemplo n.º 1
0
    public GameObject JewelInstantiatebt(int x, int y)
    {
        GameObject tmp;

        tmp         = (GameObject)Instantiate(JewelObject);
        JewelScript = tmp.GetComponent <JewelObj>();

        tmp.transform.SetParent(JewelParent.transform, false);
        //JewelScript.render.enabled = true;
        JewelGrib[x, y]       = ObjTmp;
        JewelGribScript[x, y] = JewelScript;

        int r = 0;

        if (PLayerInfo.MODE == 1)
        {
            r = Random.Range(0, 6);
        }
        else
        {
            r = Random.Range(0, 7);
        }

        JewelScript.SetSkin(r);
        JewelScript.jewel.JewelPosition = new Vector2(x, 9);
        JewelScript.jewel.JewelType     = r;
        JewelScript.jewel.JewelPower    = 0;
        return(tmp);
    }
Exemplo n.º 2
0
    public GameObject JewelInstantiate(int x, int y)
    {
        ObjTmp      = (GameObject)Instantiate(JewelObject);
        JewelScript = ObjTmp.GetComponent <JewelObj>();
        ObjTmp.transform.SetParent(JewelParent.transform, false);
        ObjTmp.transform.localPosition = new Vector3(ObjTmp.transform.localPosition.x + x * BaseDistance, ObjTmp.transform.localPosition.y + y * BaseDistance);
        JewelGrib[x, y]       = ObjTmp;
        JewelGribScript[x, y] = JewelScript;
        int r = 0;

        if (PLayerInfo.MODE == 1)
        {
            r = Random.Range(0, 6);
        }
        else
        {
            r = Random.Range(0, 7);
        }

        JewelScript.SetSkin(r);
        JewelScript.jewel.JewelPosition = new Vector2(x, y);
        JewelScript.jewel.JewelType     = r;

        return(ObjTmp);
    }
Exemplo n.º 3
0
    void JewelObjInitializer(ref GameObject jewelObj, int x, int y, int type, int power)
    {
        JewelScript                     = jewelObj.GetComponent <JewelObj>();
        JewelGrib[x, y]                 = jewelObj;
        JewelGribScript[x, y]           = JewelScript;
        JewelScript.jewel.JewelPosition = new Vector2(x, y);
        JewelScript.jewel.JewelType     = type;
        JewelScript.jewel.JewelPower    = power;

        JewelScript.SetSkin(type, power);         //Have no idea why, had to improvise on the old code
    }
Exemplo n.º 4
0
    GameObject Test(int x, int y, int r)
    {
        ObjTmp      = (GameObject)Instantiate(JewelObject);
        JewelScript = ObjTmp.GetComponent <JewelObj>();
        ObjTmp.transform.SetParent(JewelParent.transform, false);
        ObjTmp.transform.localPosition = new Vector3(x, y);
        ObjTmp.transform.GetChild(0).gameObject.transform.localScale = new Vector3(0, 0, 1);
        JewelGrib[x, y]       = ObjTmp;
        JewelGribScript[x, y] = JewelScript;


        JewelScript.SetSkin(r);
        JewelScript.jewel.JewelPosition = new Vector2(x, y);
        JewelScript.jewel.JewelType     = r;

        return(ObjTmp);
    }
Exemplo n.º 5
0
	void JewelObjInitializer(ref GameObject jewelObj,int x, int y,int type,int power)
	{
		JewelScript = jewelObj.GetComponent<JewelObj>();
		JewelGrib[x, y] = jewelObj;
		JewelGribScript[x, y] = JewelScript;
		JewelScript.jewel.JewelPosition = new Vector2(x, y);
		JewelScript.jewel.JewelType = type;
		JewelScript.jewel.JewelPower = power;

		JewelScript.SetSkin (type,power); //Have no idea why, had to improvise on the old code

	}
Exemplo n.º 6
0
    GameObject RJewelInstantiate(int x, int y)
    {
        ObjTmp = (GameObject)Instantiate(JewelObject);
        JewelScript = ObjTmp.GetComponent<JewelObj>();
        ObjTmp.transform.SetParent(JewelParent.transform, false);
        ObjTmp.transform.localPosition = new Vector3(x, y);
        ObjTmp.transform.GetChild(0).gameObject.transform.localScale = new Vector3(0, 0, 1);
        JewelGrib[x, y] = ObjTmp;
        JewelGribScript[x, y] = JewelScript;

        int r = randomjewel(x, y);

		JewelScript.SetSkin (r);
        JewelScript.jewel.JewelPosition = new Vector2(x, y);
        JewelScript.jewel.JewelType = r;

        return ObjTmp;
    }
Exemplo n.º 7
0
    public GameObject JewelInstantiatebt(int x, int y)
    {
        GameObject tmp;
        tmp = (GameObject)Instantiate(JewelObject);
        JewelScript = tmp.GetComponent<JewelObj>();

        tmp.transform.SetParent(JewelParent.transform, false);
        //JewelScript.render.enabled = true;
        JewelGrib[x, y] = ObjTmp;
        JewelGribScript[x, y] = JewelScript;

        int r = 0;

        if (PLayerInfo.MODE == 1)
            r = Random.Range(0, 6);
        else
            r = Random.Range(0, 7);

		JewelScript.SetSkin (r);
        JewelScript.jewel.JewelPosition = new Vector2(x, 9);
        JewelScript.jewel.JewelType = r;
        JewelScript.jewel.JewelPower = 0;
        return tmp;
    }
Exemplo n.º 8
0
    public GameObject JewelInstantiate(int x, int y)
    {
        ObjTmp = (GameObject)Instantiate(JewelObject);
        JewelScript = ObjTmp.GetComponent<JewelObj>();
        ObjTmp.transform.SetParent(JewelParent.transform, false);
        ObjTmp.transform.localPosition = new Vector3(ObjTmp.transform.localPosition.x + x * BaseDistance, ObjTmp.transform.localPosition.y + y * BaseDistance);
        JewelGrib[x, y] = ObjTmp;
        JewelGribScript[x, y] = JewelScript;
        int r = 0;

        if (PLayerInfo.MODE == 1)
            r = Random.Range(0, 6);
        else
            r = Random.Range(0, 7);

		JewelScript.SetSkin (r);
        JewelScript.jewel.JewelPosition = new Vector2(x, y);
        JewelScript.jewel.JewelType = r;

        return ObjTmp;
    }