Ejemplo n.º 1
0
 public ClickColorData(string s, int max, int min, float d, Color clr, primitive p)
 {
     ObjectType    = s;
     MaxClickCount = max;
     MaxClickCount = min;
     time2Change   = d;
     color         = clr;
     prim          = p;
 }
Ejemplo n.º 2
0
    void Update()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            Ray        ray = _view.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit))
            {
                if (hit.collider.gameObject.name == "Plane")
                {
                    int        i  = Random.Range(0, 3);
                    GameObject fr = new GameObject();
                    switch (i)
                    {
                    case 0:
                        fr      = Instantiate(Cube, hit.point, Quaternion.identity) as GameObject;
                        fr.name = nameOfObj.Obj1;
                        break;

                    case 1:
                        fr      = Instantiate(Sphere, hit.point, Quaternion.identity) as GameObject;
                        fr.name = nameOfObj.Obj2;
                        break;

                    case 2:
                        fr      = Instantiate(Cylinder, hit.point, Quaternion.identity) as GameObject;
                        fr.name = nameOfObj.Obj3;
                        break;
                    }

                    primitive primit = fr.AddComponent <primitive>();
                    primit.setName(fr.name);
                }
                else
                {
                    primitive p = hit.collider.gameObject.GetComponent <primitive>();
                    p.OneMoreClick();
                    //Увеличение его кол-ва кликов
                }
            }
        }
    }
Ejemplo n.º 3
0
 var(primitive, handles) = value.ToNative();
Ejemplo n.º 4
0
 public void RemoveMapping(primitive primitive)
 {
     primitive.mappingGuid = null;
 }
Ejemplo n.º 5
0
 public void UpdatePrimitiveMappingGuid(primitive primitive, Guid?newId)
 {
     primitive.mappingGuid = newId?.ToString();
     primitive.guid        = newId?.ToString();
 }