Exemplo n.º 1
0
        void update()
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                if (!AirInput.escapeDown())
                {
                    ShadowSystem.Quit();
                }
            }

            if (target != null)
            {
                //持续按鼠标
                //				SCInput.MousePosition = getMousePosition();
                drag();
                return;
            }
            get3Dof();

//			if (_enableAcc) {
//				float[] array = AndroidConnection.Instance.Call<float[]> ("unityACCMatrix");
//				if (array == null) {
//					return;
//				}
//
//				AirInput.BluetoothHandleAcc = new Vector3 (array [0], array [1], array [2]);
//				Debug.Log ("wjh.BluetoothHandleAcc====>" + AirInput.BluetoothHandleAcc.ToString ());
//			}
        }
Exemplo n.º 2
0
    void ApplyWindow()
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("", GUILayout.Width(100));

        GUIStyle styleApply = new GUIStyle("LargeButton");

        styleApply.alignment = TextAnchor.MiddleCenter;
        if (GUILayout.Button("SVR", styleApply, GUILayout.Width(100), GUILayout.Height(50)))
        {
            SlamSettings.SaveAssetDataBase(false);
            ShadowSystem ss = FindObjectOfType <ShadowSystem>();
            if (ss)
            {
                SvrManager svr = ss.transform.GetComponentInChildren <SvrManager>(true);
                if (svr)
                {
                    svr.gameObject.SetActive(true);
                }
            }
            window.Close();
            Close();
        }

        EditorGUILayout.LabelField("", GUILayout.Width(100));

        GUIStyle style1Apply = new GUIStyle("LargeButton");

        styleApply.alignment = TextAnchor.MiddleCenter;
        if (GUILayout.Button("Other", style1Apply, GUILayout.Width(100), GUILayout.Height(50)))
        {
            SlamSettings.SaveAssetDataBase(true);
            SvrManager svr = FindObjectOfType <SvrManager>();
            if (svr)
            {
                svr.gameObject.SetActive(false);
            }
            window.Close();
            Close();
        }

        EditorGUILayout.LabelField("", GUILayout.Width(100));

        EditorGUILayout.EndHorizontal();
    }
Exemplo n.º 3
0
        public override void Update(int timeLastFrame)
        {
            base.Update(timeLastFrame);
            if (!m_enable)
            {
                return;
            }

            m_spotPrey = null;
            Blacklist blacklist = Mgr <Scene> .Singleton.GetSharedObject(typeof(Blacklist).ToString())
                                  as Blacklist;

            ShadowSystem shadowSystem = GameObject.Scene.m_shadowSystem;

            if (blacklist != null)
            {
                foreach (Prey prey in blacklist.Preys)
                {
                    Vector2 preyPosition = prey.GetPointInWorld();
                    if (IsPointInOnLight(preyPosition))
                    {
                        Vector3 myPosition = GameObject.AbsPosition;
                        Vector2 dist       = preyPosition - new Vector2(myPosition.X, myPosition.Y);
                        if (dist.LengthSquared() > m_senseDistance * m_senseDistance &&
                            shadowSystem != null && !shadowSystem.IsPointEnlighted(preyPosition))
                        {
                            continue;
                        }
                        m_debugShape.DiffuseColor = Color.Red;
                        DiffuseColor = Color.Red;
                        m_spotPrey   = prey;
                    }
                }
            }
            if (!SpotAny())
            {
                m_debugShape.DiffuseColor = Color.Green;
                DiffuseColor = Color.Green;
            }
        }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     lightSystem = GetComponent <ShadowSystem>();
 }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     lightSystem           = GetComponent <ShadowSystem>();
     lightSystem.tintColor = new Color(baseBrightness + Random.Range(0f, randomColorRange), baseBrightness + Random.Range(0f, randomColorRange), baseBrightness + Random.Range(0f, randomColorRange), 1f);
 }