public override void Execute() { Primitive prim = Generator.GenPrimitive(); PrimitiveView view = GameObject.Instantiate(prim.Prefab).GetComponent <PrimitiveView>(); Vector3 pos = ClickPosition.Vector; pos.z = Camera.main.nearClipPlane + 1; Vector3 newPos = Camera.main.ScreenToWorldPoint(pos); view.transform.position = newPos; view.Name = prim.Name; }
public bool GetColor(PrimitiveView view, out Color color) { color = Color.black; foreach (ClickColorData data in GOData.ClicksData) { if (data.ObjectType == view.Name && view.Model.ClickCount.Value >= data.MinClicksCount && view.Model.ClickCount.Value <= data.MaxClicksCount) { color = data.Color; return(true); } } return(false); }