Ejemplo n.º 1
0
    private PersonalityType GetMyPersonality()
    {
        var room = PhotonArenaManager.Instance.GetRoom();

//        var playerNums = new List<int>(8); // Replace with call to get Player Numbers
        var playerNums   = room.Players.Keys;
        var playerScores = new Dictionary <int, int[]>();

        foreach (var playerNum in playerNums)
        {
            var score = PhotonArenaManager.Instance.GetData($"score!{playerNum}") as int[];

            if (score != null)
            {
                playerScores.Add(playerNum, score);
            }
        }

        var personalities = PersonalityController.SortingHat(playerScores);

        neighbourhoodMan.Personalities = personalities;

        if (personalities.ContainsKey(myPlayerID))
        {
            return(personalities[myPlayerID]);
        }

        return(PersonalityType.Nerd);
    }
Ejemplo n.º 2
0
    void Start()
    {
        colorNormal    = new Color32(0xFF, 0xFF, 0xFF, 0xFF);
        colorAttack    = new Color32(0xFF, 0xC2, 0xC2, 0xFF);
        colorSocialize = new Color32(0xFF, 0xF2, 0xF9, 0xFF);

        winText                 = canvas.transform.GetChild(0).GetComponent <Text>();
        timerTextSeconds        = canvas.transform.GetChild(10).GetComponent <Text>();
        timerTextMilliseconds   = canvas.transform.GetChild(11).GetComponent <Text>();
        imageCurrentPersonality = canvas.transform.GetChild(6).GetComponent <Image>();

        thisPersonalityController = this;

        thirdPersonCamera = cameras.transform.GetChild(0).GetComponent <Camera>();
        camGoals          = cameras.transform.GetChild(1).GetComponent <Camera>();
        camEntities       = cameras.transform.GetChild(2).GetComponent <Camera>();

        postProcessingBehaviour         = thirdPersonCamera.gameObject.GetComponent <PostProcessingBehaviour>();
        postProcessingBehaviour.enabled = false;
        playerControllerRigid           = GetComponent <PlayerControllerRigidBody>();
        camGoals.enabled     = false;
        camEntities.enabled  = false;
        attackTimer          = 0.0f;
        spriteAttack.enabled = false;
        spriteSocial.enabled = false;
        Debug.Log("Change state code");
        ChangeState(Personality.FIND);

        for (int i = 0; i < targetLocations.Length; i++)
        {
            targetLocations[i].GetComponent <Renderer>().material = nonTargetMaterial;
        }

        if (targetLocations.Length > 0)
        {
            targetLocations[0].GetComponent <Renderer>().material = targetMaterial;
        }
        currentTargetLocation = 0;

        winText.enabled   = false;
        layerMaskEntities = 1 << layerMaskEntities;

        GameManager.StartDialogue();

        Debug.Log("End start");
    }