// Start is called before the first frame update void Start() { Instance = this; unitokens = new List <Unitoken>(); Arcs = new List <Arc>(); if (arcMapLayout == null) { arcMapLayout = GetComponent <ArcMapLayout>(); } if (tokenFactory == null) { tokenFactory = GetComponent <TokenFactory>(); } if (arcFactory == null) { arcFactory = GetComponent <ArcFactory>(); } tokenFactory.Initialize(); arcFactory.Initialize(); mCamera = Camera.main; }
private void Update() { Vector3 character_position = main_character.forward; Vector3 controller_position = main_controller.forward; List <SerializedArc> laser = new List <SerializedArc> { ArcFactory.line(character_position, controller_position) }; arc_renderer.shape = PlanetariaShape.Create(laser, false); arc_renderer.recalculate(); bool firing; #if UNITY_EDITOR firing = Input.GetButton("Fire1"); #else firing = Input.GetButton("OSVR_IndexTrigger"); #endif if (firing) { arc_renderer.material.color = Color.red; } else { arc_renderer.material.color = Color.blue; } /*PlanetariaRaycastHit[] collision_info = PlanetariaPhysics.raycast_all(Arc.line(character_position, controller_position)); * Vector3 last_position = character_position; * bool blue = true; * Color color; * foreach (PlanetariaRaycastHit hit in collision_info) * { * color = blue ? Color.blue : Color.red; * Debug.DrawLine(last_position, hit.point, color); * last_position = hit.point; * blue = !blue; * } * color = blue ? Color.blue : Color.red; * Debug.DrawLine(last_position, controller_position, color); * arc_renderer.*/ /*if (Input.GetButtonDown("Jump")) * { * PlanetariaGameObject.Instantiate(prefabricated_object, controller_position); * //Destroy(new object, 3 seconds) + test Destroy for PlanetariaGameObject * }*/ }
internal void Initialize() { Instance = this; //throw new NotImplementedException(); }