Example #1
0
 /// <summary>
 /// Sets up the ExtensionFilter array.
 /// Puts new mesh into MeshFilter component of the objectForExport.
 /// Finds the sizeChanger in the scene.
 /// </summary>
 private void Start()
 {
     extensionList = new ExtensionFilter[] {
         new ExtensionFilter("Binary STL", "stl"),
         new ExtensionFilter("Wavefront OBJ", "obj")
     };
     objectForExport.transform.GetComponent <MeshFilter>().mesh = new Mesh();
     sizeChanger = GameObject.Find("SizeChanger").GetComponent <SizeChanger>();
 }
Example #2
0
        private void CreateSizeChanger()
        {
            SizeChanger                       = AddUIComponent <UIPanel>();
            SizeChanger.size                  = new Vector2(9, 9);
            SizeChanger.atlas                 = TextureHelper.CommonAtlas;
            SizeChanger.backgroundSprite      = TextureHelper.ResizeSprite;
            SizeChanger.color                 = new Color32(255, 255, 255, 160);
            SizeChanger.eventPositionChanged += SizeChangerPositionChanged;

            var handle = SizeChanger.AddUIComponent <UIDragHandle>();

            handle.size             = SizeChanger.size;
            handle.relativePosition = Vector2.zero;
            handle.target           = SizeChanger;
        }
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         SizeChanger size = other.GetComponent <SizeChanger>();
         print(size.meshArrayOrder);
         if (size.meshArrayOrder >= min && size.meshArrayOrder <= max)
         {
             print(size.meshArrayOrder);
             MultiplyTotalPoint();
             other.GetComponent <AnimationController>().Win();
             FindObjectOfType <ReplayScript>().ShowReplay();
         }
     }
 }
        private void CreateSizeChanger()
        {
            Log.Debug("LaneManagerPanel.CreateSizeChanger(): " + size.ToString());
            SizeChanger                       = AddUIComponent <UIPanel>();
            SizeChanger.size                  = new Vector2(9, 9);
            SizeChanger.atlas                 = ResizeAtlas;
            SizeChanger.backgroundSprite      = "resize";
            SizeChanger.color                 = new Color32(255, 255, 255, 160);
            SizeChanger.eventPositionChanged += SizeChangerPositionChanged;

            var handle = SizeChanger.AddUIComponent <UIDragHandle>();

            handle.size             = SizeChanger.size;
            handle.relativePosition = Vector2.zero;
            handle.target           = SizeChanger;
        }
Example #5
0
    // Start is called before the first frame update


    void Start()
    {
        publicCamera = GetComponent <Camera>();
        publicCamera.orthographicSize = minSize;
        //publicCamera.aspect = publicCamera.rect.width / publicCamera.rect.height;
        prevCameraObj = new GameObject();
        prevCamera    = prevCameraObj.AddComponent <Camera>();
        prevCamera.CopyFrom(publicCamera);
        prevCamera.orthographicSize = prevCamera.orthographicSize - variation;
        prevCamera.depth            = prevCamera.depth - 1f;

        sizeChanger = GetComponent <SizeChanger>();
        sizeChanger.Init(publicCamera);

        publicCoroutine = StartCoroutine(monitorPublicCamera());
        prevCoroutine   = StartCoroutine(monitorPrevCamera());
    }
 public void GainScaleWitgFood(SizeChanger sizeChanger)
 {
     sizeChanger.meshArrayOrderIncrease(GainWeightAmounthMeshArraySize);
     sizeChanger.MeshChange();
 }