Пример #1
0
        private static void LedBufferWork()
        {
            byte[] originalGamma =
            {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
                0x02, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07,
                0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, 0x0F, 0x11,
                0x12, 0x14, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F
            };

            double senseHatGamma = FindBestGammaMatch.Best5BitGammaMatch(originalGamma, 2, 3, 0.01);

            byte[] senseHatGammaTable       = GammaCalc.Get5BitGamma(senseHatGamma).ToArray();
            string senseHatGammaTableAsCode = ToCSharp(senseHatGammaTable);

            byte[] senseHatInverseGammaTable       = GammaCalc.Get5To8BitInvertedGamma(senseHatGamma).ToArray();
            string senseHatInverseGammaTableAsCode = ToCSharp(senseHatInverseGammaTable);



            Color[,] initalPixels = LedBufferSupport.BufferToPixels(LedBufferSupport.GetInitialLedBuffer(), senseHatGamma);
            string initalPixelsAsCode = ToCSharp(initalPixels);

            byte[] initialBufferRecreated       = LedBufferSupport.PixelsToBuffer(initalPixels, senseHatGamma);
            string initialBufferRecreatedAsCode = ToCSharp(initialBufferRecreated);
            string originalInitialBufferAsCode  = ToCSharp(LedBufferSupport.GetInitialLedBuffer());

            var xxx = initialBufferRecreatedAsCode + "\r\n" + originalInitialBufferAsCode;

            RotationTest.Test();
        }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        Vector3 playerRotation = player.PlayerRotation();

        Debug.Log(playerRotation);
        RotationTest roatationObject = GameObject.FindObjectOfType <RotationTest> ();

        roatationObject.transform.rotation = Quaternion.Euler(playerRotation);
    }
Пример #3
0
    public void Start()
    {
        this.LookMode  = false;
        this.windOnOff = false;
        this.timeData  = Time.realtimeSinceStartup;

        this.expression = 0f;

        this.oldLookPos = Vector3.zero;
        if (this.LookTarget != null)
        {
            this.oldLookPos = this.LookTarget.transform.position;
        }

        GameObject CameraObj = GameObject.FindWithTag("MainCamera");
        GameObject InfoObj   = GameObject.Find("CanvasInfo/info");

        if (InfoObj != null)
        {
            Text infoTextObj = InfoObj.GetComponent <Text>();

            if (infoTextObj != null)
            {
                this.infoText = infoTextObj;
            }
        }
        else
        {
            Debug.Log("InfoObj Null!");
        }

        if (this.AnimatorObject != null)
        {
            this.animator = this.AnimatorObject.GetComponent <Animator>();
        }

        if (CameraObj != null)
        {
            this.CamOpe = CameraObj.GetComponent <CameraOperation>();
            this.RotTes = CameraObj.GetComponent <RotationTest>();

            this.camTra = CameraObj.transform;
        }
        else
        {
            Debug.Log("CameraObj Null!");
        }

        if (this.CamOpe == null)
        {
            Debug.Log("CameraOperation Null!");
        }

        if (this.RotTes == null)
        {
            Debug.Log("RotationTest Null!");
        }

        if (this.TLSObject != null)
        {
            TargetLookSet[] tlSa = this.TLSObject.GetComponents <TargetLookSet>();
            if (tlSa != null)
            {
                for (int ti = 0; ti < tlSa.Length; ti++)
                {
                    for (int oi = 0; oi < tlSa[ti].OperationObj.Length; oi++)
                    {
                        if (tlSa[ti].OperationObj[oi].transform.name == "Head")
                        {
                            this.targetlS = tlSa[ti];
                        }
                    }
                }
            }
        }
        else
        {
            Debug.Log("TLSObject Null!");
        }


        GameObject DollEventObj = GameObject.Find("DollEventSystem");

        if (DollEventObj != null)
        {
            this.ddSst = DollEventObj.GetComponents <DemoDataSet>();

            if (this.ddSst != null)
            {
                for (int di = 0; di < this.ddSst.Length; di++)
                {
                    if (this.ddSst[di].EffectName == "SHEffect")
                    {
                        this.sjWco = this.ddSst[di].sjClass;
                    }
                }
            }
        }
    }