Skip to content
Snippets Groups Projects
Select Git revision
  • bed13c1ce2a78bd58f32bbc33fb91905f9c3b14b
  • master default
  • JS-based-scroll-rendering
  • Paul_Marius_Level
  • Paul_Marius_2
  • Paul_Marius
  • Andi_Mark
  • be-UnityWebView
  • gitignoreFrameitServer
  • ZimmerBSc
  • Bugfix_StageLoading
  • stages
  • MAZIFAU_Experimental
  • tsc/coneworld
  • tsc/fact-interaction
  • marcel
  • MaZiFAU_TopSort
  • mergeHelper
  • zwischenSpeichern
  • tempAndrToMaster
  • SebBranch
  • 3.0
  • v2.1
  • v2.0
  • v1.0
25 results

FactManager.cs

Blame
    • MaZiFAU's avatar
      510b4f23
      Refactoring Hint Animation; · 510b4f23
      MaZiFAU authored
      Refactoring:
      -Eventbased Hint animation extended to sprites
      +->Added FactObjectUI
      +->Moved FactWrapper tree in own folder
      +->Used RectMask (does not work with normal one)
      510b4f23
      History
      Refactoring Hint Animation;
      MaZiFAU authored
      Refactoring:
      -Eventbased Hint animation extended to sprites
      +->Added FactObjectUI
      +->Moved FactWrapper tree in own folder
      +->Used RectMask (does not work with normal one)
    FactManager.cs 5.96 KiB
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using TMPro;
    using UnityEngine;
    using static CommunicationEvents;
    public class FactManager : MonoBehaviour
    {
        public GameObject SmartMenu;
        private List<int> NextEmpties = new List<int>();
    
    
    
        // Start is called before the first frame update
        void Start()
        {
    
            //  CommunicationEvents.SnapEvent.AddListener(Rocket);
    
            //We dont want to have this here anymore...
            //CommunicationEvents.RemoveFactEvent.AddListener(DeleteFact);
    
            NextEmpties.Add(0);
    
        }
    
    
    
    
    
        // Update is called once per frame
        void Update()
        {
    
        }
    
        //TODO: change the return find....
        public PointFact AddPointFact(RaycastHit hit, int id)
        {
            Facts.Insert(id, new PointFact(id, hit.point, hit.normal));
            return Facts.Find(x => x.Id == id) as PointFact;
        }
    
        public LineFact AddLineFact(int pid1, int pid2, int id)
        {
            Facts.Insert(id, new LineFact(id, pid1, pid2));
    
            return Facts.Find(x => x.Id == id) as LineFact;
        }
        public RayFact AddRayFact(int pid1, int pid2, int id)
        {
            Facts.Insert(id, new RayFact(id, pid1, pid2));
    
            var oLid = GetFirstEmptyID();
            Facts.Insert(oLid, new OnLineFact(oLid, pid1, id));
            oLid = GetFirstEmptyID();
            Facts.Insert(oLid, new OnLineFact(oLid, pid2, id));
    
            var p1 = Facts.Find(x => x.Id == pid1);
            var p2 = Facts.Find(x => x.Id == pid2);
    
            Vector3 dir = p2.Representation.transform.position - p1.Representation.transform.position;
    
        
    
            // Bit shift the index of the layer Point to get a bit mask
            int layerMask = 1 << LayerMask.NameToLayer("Point");
            // This casts rays only against colliders in layer 8