Commit 1bdb6cb7 authored by BlackAngle233's avatar BlackAngle233
Browse files

2021_6_1_14_45

parent 07399915
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: 39bc7e7b244b82542b17c6ebeadb8ecd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6658da0b86525fc4499692f44c3370fa
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 13021387cf451a640bc3ed5891b6af8d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 5b86e571ea2b50447866c8f9d0733c5b
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
...@@ -364,28 +364,28 @@ public class CanvasManager3D : MonoBehaviour ...@@ -364,28 +364,28 @@ public class CanvasManager3D : MonoBehaviour
Point a = new Point(0, 1, 0); Point a = new Point(0, 1, 0);
Point b = new Point(0, 0, 0); Point b = new Point(0, 0, 0);
Point c = new Point(1, 0, 0); Point c = new Point(1, 0, 0);
//Point d = new Point(1, 1, 0); Point d = new Point(1, 1, 0);
//Point e = new Point(0.5f, 1, 0.5f); Point e = new Point(0.5f, 1, 0.5f);
//Point f = new Point(0.5f, 0, 0); Point f = new Point(0.5f, 0, 0);
//Point g = new Point(0.25f, 1, 0.25f); Point g = new Point(0.25f, 1, 0.25f);
points.Add("A", a); points.Add("A", a);
points.Add("B", b); points.Add("B", b);
points.Add("C", c); points.Add("C", c);
//points.Add("D", d); points.Add("D", d);
//points.Add("E", e); points.Add("E", e);
//points.Add("F", f); points.Add("F", f);
//points.Add("G", g); points.Add("G", g);
lines.Add("AB", new Line(a, b)); lines.Add("AB", new Line(a, b));
lines.Add("BC", new Line(b, c)); lines.Add("BC", new Line(b, c));
//lines.Add("CD", new Line(c, d)); lines.Add("CD", new Line(c, d));
//lines.Add("AD", new Line(a, d)); lines.Add("AD", new Line(a, d));
//lines.Add("AE", new Line(a, e)); lines.Add("AE", new Line(a, e));
//lines.Add("DE", new Line(d, e)); lines.Add("DE", new Line(d, e));
//lines.Add("CE", new Line(c, e)); lines.Add("CE", new Line(c, e));
//lines.Add("FG", new Line(f, g)); lines.Add("FG", new Line(f, g));
isFin = true; isFin = true;
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Controller : MonoBehaviour
{
private Touch _OldTouch1;
private Touch _OldTouch2;
Vector2 _M_Screenpos = new Vector2();
bool _bMoveOrRotation;
Vector3 _OldPosition;
void Start()
{
_OldPosition = Camera.main.transform.position;
}
void Update()
{
if (Input.touchCount <= 0)
{
return;
}
if (1 == Input.touchCount)
{
if (_bMoveOrRotation)
{
Touch _Touch = Input.GetTouch(0);
Vector2 _DeltaPos = _Touch.deltaPosition;
transform.Rotate(Vector3.down * _DeltaPos.x, Space.World);
transform.Rotate(Vector3.right * _DeltaPos.y, Space.World);
}
else
{
if (Input.touches[0].phase == TouchPhase.Began)
{
_M_Screenpos = Input.touches[0].position;
}
else if (Input.touches[0].phase == TouchPhase.Moved)
{
Camera.main.transform.Translate(new Vector3(-Input.touches[0].deltaPosition.x * Time.deltaTime * 0.1f, -Input.touches[0].deltaPosition.y * Time.deltaTime * 0.1f, 0));
}
}
}
Touch _NewTouch1 = Input.GetTouch(0);
Touch _NewTouch2 = Input.GetTouch(1);
if (_NewTouch2.phase == TouchPhase.Began)
{
_OldTouch2 = _NewTouch2;
_OldTouch1 = _NewTouch1;
return;
}
float _OldDistance = Vector2.Distance(_OldTouch1.position, _OldTouch2.position);
float _NewDistance = Vector2.Distance(_NewTouch1.position, _NewTouch2.position);
float _Offset = _NewDistance - _OldDistance;
float _ScaleFactor = _Offset / 100f;
Vector3 _LocalScale = transform.localScale;
Vector3 _Scale = new Vector3(_LocalScale.x + _ScaleFactor,
_LocalScale.y + _ScaleFactor,
_LocalScale.z + _ScaleFactor);
if (_Scale.x > 0.3f && _Scale.y > 0.3f && _Scale.z > 0.3f)
{
transform.localScale = _Scale;
}
_OldTouch1 = _NewTouch1;
_OldTouch2 = _NewTouch2;
}
public void BackPosition()
{
Camera.main.transform.position = _OldPosition;
Camera.main.transform.eulerAngles = Vector3.zero;
}
public void RotationOrMove()
{
_bMoveOrRotation = !_bMoveOrRotation;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 19d4823d2f70fba4bb0b9121dc196d89
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using ZXing;//引入库  
using ZXing.QrCode; 
public class QRcode : MonoBehaviour
{
    public Texture2D encoded;
    public string Lastresult;
    void Start()  
    {
        encoded = new Texture2D(256, 256);  
        Lastresult = "http://www.qq.com";  
    }
  
    private static Color32[] Encode(string textForEncoding, int width, int height)  
    {  
        var writer = new BarcodeWriter  
        {  
            Format = BarcodeFormat.QR_CODE,  
            Options = new QrCodeEncodingOptions  
            {  
                Height = height,  
                Width = width  
            }  
        };  
        return writer.Write(textForEncoding);  
    }  
  
  
    public void Save()  
    {  
        var textForEncoding = Lastresult;  
        if (textForEncoding != null)  
        {   
            var color32 = Encode(textForEncoding, encoded.width, encoded.height);  
            encoded.SetPixels32(color32);  
            encoded.Apply();
byte[] bytes = encoded.EncodeToPNG();
string path = Application.persistentDataPath;
Debug.Log(path);
#if UNITY_ANDROID
path = "/storage/emulated/0/DCIM/MathTec";
#endif
if (Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string savePath = string.Format("{0}/{1}.png", path, "pic");
File.WriteAllBytes(savePath, bytes);
        }  
    }  
  
}
\ No newline at end of file
fileFormatVersion: 2
guid: 341a32be5dc6c0e4f99bd2d98ea5a5c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -10,6 +10,8 @@ public class UIManager : MonoBehaviour ...@@ -10,6 +10,8 @@ public class UIManager : MonoBehaviour
List<GameObject> planes; List<GameObject> planes;
List<GameObject> constraints; List<GameObject> constraints;
public List<GameObject> UIControl;
public GameObject constraintDropdown; public GameObject constraintDropdown;
public GameObject constraintInput; public GameObject constraintInput;
...@@ -302,11 +304,22 @@ public class UIManager : MonoBehaviour ...@@ -302,11 +304,22 @@ public class UIManager : MonoBehaviour
GameObject tmp = Instantiate(constraint); GameObject tmp = Instantiate(constraint);
tmp.transform.SetParent(constraintParent); tmp.transform.SetParent(constraintParent);
constraints.Add(tmp); constraints.Add(tmp);
if(constraints.Count < 11)
tmp.transform.localPosition = new Vector3(150 + 165 * (constraints.Count - 1), 0, 0); tmp.transform.localPosition = new Vector3(150 + 165 * (constraints.Count - 1), 0, 0);
else
tmp.transform.localPosition = new Vector3(150 + 165 * (constraints.Count - 11), -80, 0);
tmp.GetComponentInChildren<Text>().text = n; tmp.GetComponentInChildren<Text>().text = n;
state = UIState.none; state = UIState.none;
constraintDropdown.GetComponent<Dropdown>().captionText.text = "None"; constraintDropdown.GetComponent<Dropdown>().captionText.text = "None";
constraintDropdown.GetComponent<Dropdown>().value = 0; constraintDropdown.GetComponent<Dropdown>().value = 0;
constraintDropdown.SetActive(false); constraintDropdown.SetActive(false);
} }
public void UIShow()
{
foreach(var ui in UIControl)
{
ui.SetActive(!ui.activeSelf);
}
}
} }
fileFormatVersion: 2
guid: be3555aa3d1aa6a40879bdbd184ac036
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment