Пример #1
0
 void Awake()
 {
     Instance = this;
     Stars    = new Dictionary <Guid, GameData.Star>();
     Links    = new List <GameData.Link>();
     LastStar = null;
 }
Пример #2
0
    void Awake()
    {
        Instance   = this;
        Stars      = new Dictionary <Guid, GameData.Star>();
        Links      = new List <GameData.Link>();
        LastStarId = null;

        ConstellationNameSetup();
    }
Пример #3
0
    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else if (_instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Пример #4
0
    void Start()
    {
        init();
        GameObject           cS = Instantiate(constellationSpawner);
        ConstellationManager cM = cS.GetComponent <ConstellationManager>();

        NodeInfo mov;

        mov.type      = NodeType.custom;
        mov.name      = "Instructions";
        mov.details   = "Mix and the genres to apply filters! Once you have selected the genres you wish to have simply place the new node in the world. From there take other nodes and spawn further nodes!";
        mov.genreType = GenreType.None;
        cM.init(mov);

        foreach (KeyValuePair <GenreType, NodeInfo> t in genreTypeNodes)
        {
            if (t.Key == GenreType.None)
            {
                continue;
            }
            cM.addNode(t.Value);
        }
    }
Пример #5
0
    /* Spawns a constellation using the nodes currently selected */
    private void spawnConstellation()
    {
        if (selection.Count <= 0)
        {
            return;
        }

        Vector3         tColor = Vector3.zero;
        List <NodeInfo> info   = new List <NodeInfo>();
        NodeInfo        n;
        GameObject      theFab = customNodeFab;

        n.name      = "";
        n.details   = "";
        n.type      = NodeType.custom;
        n.genreType = GenreType.None;
        bool noSkip = true;

        // Special case for movies
        if (selection.Count == 1)
        {
            foreach (GameObject nObject in selection.Values)
            {
                if (nObject.GetComponent <NormalNode>().getType() == NodeType.movie)
                {
                    info = dataContainer.fromMovie(nObject.GetComponent <NormalNode>().getInfo().name);
                    n    = info[0];
                    info.RemoveAt(0);
                    noSkip = false;
                    theFab = movieNodeFab;
                    Color tempColor = nObject.GetComponent <Renderer>().material.color;
                    tColor = new Vector3(tempColor.r, tempColor.g, tempColor.b);
                    nObject.GetComponent <NormalNode>().remove();
                }
            }
        }

        // If no movies see if all the objects are a genre
        if (noSkip)
        {
            bool             isGenre = true;
            List <GenreType> gens    = new List <GenreType>();
            foreach (GameObject nObject in selection.Values)
            {
                if (nObject.GetComponent <NormalNode>().getType() != NodeType.genre)
                {
                    isGenre = false;
                }
                else
                {
                    gens.Add(nObject.GetComponent <NormalNode>().getInfo().genreType);
                }
            }

            n.name    = "Custom Node";
            n.details = "Filters: ";

            // Add in the custom node text
            foreach (GameObject o in selection.Values)
            {
                NormalNode nN = o.GetComponent <NormalNode>();
                n.details += nN.getInfo().name + ", ";
                info.Add(nN.getInfo());
                Color c = nN.getColor();
                tColor += new Vector3(c.r, c.g, c.b);
                nN.remove();
            }
            tColor /= info.Count;
            // If it's a genre load the relevent movies
            if (isGenre)
            {
                info = dataContainer.fromGenres(gens);
            }
        }
        selection.Clear();

        GameObject constellation = Instantiate(ConstellationSpawner);

        constellation.transform.position = controllerPose.transform.position;
        ConstellationManager cM = constellation.GetComponent <ConstellationManager>();

        cM.init(n, theFab, 0.50f);
        cM.mainNode.setColor(new Color(tColor.x, tColor.y, tColor.z));

        // Spawn the nodes
        foreach (NodeInfo i in info)
        {
            NormalNode nN = cM.addNode(i);
            if (nN.getType() == NodeType.movie)
            {
                nN.setColor(new Color(Random.value, Random.value, Random.value));
            }
        }
        cM.mainNode.setColor(new Color(tColor.x, tColor.y, tColor.z));
    }
Пример #6
0
    private void LateUpdate()
    {
        PlayerEntity currentPlayer = GameManager.Instance.GetPlayer();

        // For displaying lookup
        // If facing down
        if ((GameManager.Instance.GetCurrentState() == GameManager.GameState.FreeRoam || GameManager.Instance.GetCurrentState() == GameManager.GameState.MatchStarsMode) &&
            (Vector3.Dot(currentPlayer.transform.forward, Vector3.down) > 0.3))
        {
            // if time to change visibility
            if (_currentLookUpBlinkTime <= 0)
            {
                // Adjust blinks based upon active or inactive
                if (lookUpPanel.activeSelf)
                {
                    lookUpPanel.SetActive(false);
                    _currentLookUpBlinkTime = lookUpBlinkDelay * lookUpBlinkPortionUnvisible;
                }
                else
                {
                    lookUpPanel.SetActive(true);
                    _currentLookUpBlinkTime = lookUpBlinkDelay;
                }
            }
            _currentLookUpBlinkTime -= Time.deltaTime;
        }
        // If facing up
        else
        {
            if (lookUpPanel.activeSelf)
            {
                lookUpPanel.SetActive(false);
            }
        }



        // For displaying constellation screen
        if (constellationMatchItemId >= 0 && constellationMatchScreenPanel.activeInHierarchy)
        {
            constellationMatchScreenPanel.transform.rotation = Quaternion.LookRotation(currentPlayer.transform.forward, currentPlayer.transform.up);

            MusicManager.Instance.UpdateFindingDistanceMusic(ConstellationMatch, constellationMatchScreenPanel);
            if (ConstellationManager.IsMatchConstellation(ConstellationMatch, constellationMatchScreenPanel))
            {
                if (ConstellationManager.Instance.constellationItemList[constellationMatchItemId].displayInMap.GetComponent <ConstellationDisplayItem>().hasAnimation)
                {
                    ConstellationManager.Instance.constellationItemList[constellationMatchItemId].displayInMap.GetComponent <ConstellationDisplayItem>().isAnimated = true;
                    if (ConstellationManager.Instance.constellationItemList[constellationMatchItemId].displayInMap.GetComponent <ConstellationDisplayItem>().isCongratulation)
                    {
                        matchConstellation();
                    }
                }
                else
                {
                    matchConstellation();
                }
            }
            else
            {
                ConstellationManager.Instance.constellationItemList[constellationMatchItemId].displayInMap.GetComponent <ConstellationDisplayItem>().isAnimated = false;
            }
        }
    }
Пример #7
0
 private void Start()
 {
     constellationManager = GetComponent <ConstellationManager>();
 }
 public void SetCM(ConstellationManager constellationManager)
 {
     cm = constellationManager;
 }
 void Start()
 {
     actions      = PlayerActions.BindAll();
     rigid        = GetComponent <Rigidbody>();
     constManager = ConstellationManager.Instance;
 }