void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "Pink Ghost(Clone)" && playerOneCanCollect == true)
        {
            GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <GameCountScript> ().keyCount++;
            Destroy(gameObject);
            return;
        }

        else if (other.gameObject.name == "Blue Ghost(Clone)" && playerTwoCanCollect == true)
        {
            GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <GameCountScript> ().keyCount++;
            Destroy(gameObject);
            return;
        }

        else if (other.gameObject.name == "Pink Ghost(Clone)" && playerOneCanCollect == false)
        {
            TurnManagerScript turnManager = GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <TurnManagerScript> ();
            turnManager.gameLost = true;
            turnManager.LoseGame();
            return;
        }

        else if (other.gameObject.name == "Blue Ghost(Clone)" && playerTwoCanCollect == false)
        {
            TurnManagerScript turnManager = GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <TurnManagerScript> ();
            turnManager.gameLost = true;
            turnManager.LoseGame();

            return;
        }
    }
Beispiel #2
0
    public void Save(TurnManagerScript tm)
    {
        FileStream file = File.Open(Application.persistentDataPath + "/save.dat", FileMode.Create);

        tm.Save(file);

        file.Close();
    }
Beispiel #3
0
    void FindTurnMan()
    {
        turnMan = GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <TurnManagerScript> ();

        while (turnMan == null)
        {
            turnMan = GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <TurnManagerScript> ();
            Debug.Log("FINDING NOTHING");
        }
    }
Beispiel #4
0
    void Start()
    {
        turnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        players           = turnManagerScript.getPlayers();

        if (turnManagerScript.getCurrentPlayerIndex() <= players.Count - 1)
        {
            ShowPlayerToPassTo();
        }
    }
Beispiel #5
0
    public void Load(TurnManagerScript tm)
    {
        if (File.Exists(Application.persistentDataPath + "/save.dat"))
        {
            FileStream file = File.Open(Application.persistentDataPath + "/save.dat", FileMode.Open);

            tm.Load(file);

            file.Close();
        }
    }
Beispiel #6
0
    void Start()
    {
        mTurnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        mRestaurantScript  = GameManagerScript.GetInstance().GetComponent <RestaurantScript>();
        //mPlayerList = GameManagerScript.GetInstance().GetComponent<TurnManagerScript>().getPlayers();
        mAngleBetweenPlayers = 360.0f / mRestaurantScript.getAlivePlayers().Count;

        mRotation         = Vector3.zero;
        mPrevRotation     = 0;
        mAccumulatedAngle = 0;
    }
Beispiel #7
0
    // Use this for initialization
    void Start()
    {
        turnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        players           = turnManagerScript.getPlayers();

        ShowUsername();
        //In the future we can add cool artwork here for each role and stuff.
        ShowRoleText();

        PerformRoleAction();
    }
Beispiel #8
0
    void Start()
    {
        mTurnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        mRestaurantScript  = GameManagerScript.GetInstance().GetComponent <RestaurantScript>();

        List <Player> players = mRestaurantScript.getAlivePlayers();

        if (mTurnManagerScript.GetCurrentPlayerIndex() <= players.Count - 1)
        {
            ShowPlayerToPassTo();
        }
    }
Beispiel #9
0
    void Start()
    {
        mInputPrefab = Resources.Load <InputField>("UsernameField");
        mTurnManager = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();

        mUsernames      = new List <string>();
        mUsernameFields = new List <InputField>();
        mValidUserRoles = mTurnManager.getValidRoles();
        mPlayerCount    = mTurnManager.getPlayerCount();

        PlaceLabelsInCircle();
    }
Beispiel #10
0
    void Start()
    {
        mTurnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        mRestaurantScript  = GameManagerScript.GetInstance().GetComponent <RestaurantScript>();
        mInputPrefab       = Resources.Load <InputField>("UsernameField");

        mUsernames      = new List <string>();
        mUsernameFields = new List <InputField>();

        mValidUserRoles = Player.sValidRoles;

        PlaceLabelsInCircle();
    }
    public void RotateWindmill()
    {
        if (turnMan == null)
        {
            turnMan = GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <TurnManagerScript> ();
            players = GameObject.FindGameObjectsWithTag("Player");
        }

//		if (turnMan.winning == true) {
//
//			if (ghostOne != null || ghostTwo != null) {
//				Debug.Log (ghostOne.name + "in the rotato");
//
//				for (int i = 0; i < players.Length; i++) {
//
//					if (players [i] != ghostOne && ghostTwo == null) {
//
//						players[i] = ghostTwo;
//						players[i].transform.parent = gameObject.transform;
//
//
//					}
//
//				}
//
//			//	players [0].transform.SetParent (players [1].transform, true);
//			//	Invoke ("UnhookBots", 1.0f);
//
//
//			}
//
//		}



        if (ghostOne != null)
        {
            RotateGhostOne();
        }

        if (ghostTwo != null)
        {
            RotateGhostTwo();
        }

        Quaternion rotation2 = Quaternion.Euler(new Vector3(0, 90 * direction, 0));

        StartCoroutine(RotateObject(gameObject, rotation2, 1.0f));
    }
Beispiel #12
0
    // Use this for initialization
    void Start()
    {
        turnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        players           = turnManagerScript.getPlayers();

        mUserButtonPrefab = Resources.Load <Button>("UserButton");

        mPlayerButtons = new Dictionary <Player, Button>();

        ShowUsername();
        //In the future we can add cool artwork here for each role and stuff.
        ShowRole();

        //PerformRoleAction();
    }
Beispiel #13
0
    void Start()
    {
        mTurnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        mRestaurantScript  = GameManagerScript.GetInstance().GetComponent <RestaurantScript>();
        //players = mTurnManagerScript.getPlayers();

        mPlatePrefab  = Resources.Load <Button>("Dinner Plate");
        mPlayerPrefab = Resources.Load <Button>("UserButton");

        mPlayerNamecards = new List <Button>();
        mPlayerMeals     = new List <Button>();

        PlacePlayersInCircle();
        PlacePlatesInCircle();
        UpdateMealColors();
    }
Beispiel #14
0
    // Use this for initialization
    void Start()
    {
        mTurnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        mRestaurantScript  = GameManagerScript.GetInstance().GetComponent <RestaurantScript>();
        //players = GameManagerScript.sRestaurant.getAllPlayers();

        mUserButtonPrefab = Resources.Load <Button>("UserButton");

        mPlayerNamecards = new List <Button>();

        ShowUsername();
        //In the future we can add cool artwork here for each role and stuff.
        ShowRole();

        //PerformRoleAction();
    }
Beispiel #15
0
    //AudioManager aScript;

    // Use this for initialization
    void Start()
    {
        int x = 20;
        int y = 40;

        GameObject turnMan     = Instantiate(tmanager);
        GameObject mapCreator  = Instantiate(mcreator);
        GameObject unitCreator = Instantiate(ucreator);
        GameObject inputMan    = Instantiate(imanager);

        //GameObject audioMan = Instantiate (amanager);
        tScript         = turnMan.GetComponent <TurnManagerScript> ();
        mScript         = mapCreator.GetComponent <MapCreation> ();
        uScript         = unitCreator.GetComponent <UnitCreator> ();
        iScript         = inputMan.GetComponent <InputManagerScript> ();
        uScript.mapSize = new Vector2(20, 40);

        int[,] map = new int [x, y];
        for (int i = 0; i < x; ++i)
        {
            for (int j = 0; j < y; ++j)
            {
                if (i == 0 || i == x - 1 || j == 0 || j == y - 1)
                {
                    map [i, j] = 0;
                }
                else
                {
                    map [i, j] = Random.Range(1, 4);
                }
            }
        }
        //just to test
        map [10, 10] = -1;
        map [10, 20] = -1;
        mScript.setMatrix(map, x, y, new Vector3(45, -45, 0), 0.8f, Color.white);

        uScript.tutorialUnits();
        turnMan.GetComponent <TurnManagerScript> ().unitMap  = uScript.getUnitMap();
        turnMan.GetComponent <TurnManagerScript> ().unitList = uScript.getUnitLists();
        tScript.mapSize = new Vector2(20, 40);
        tScript.terrain = map;
        inputMan.GetComponent <InputManagerScript> ().setTurnMan(tScript);
        inputMan.GetComponent <InputManagerScript> ().setMapCreat(mScript);
    }
Beispiel #16
0
    void Start()
    {
        //Sets Status Enum
        currentStatus = Status.Initial;
        currentAction = Action.Idle;

        //Initially player's turn.
        IsPlayerTurn = true;

        //Grab TurnManagerScript
        turnManager = GameObject.Find("TurnManager").GetComponent <TurnManagerScript>();

        //Camera Rotation startup
        cameraDummy = GameObject.Find("PlayerCameraDummy");

        //Find the first PC on startup
        cvc = gameObject.GetComponent <CinemachineVirtualCamera>();
        if (pcList == null)
        {
            UpdatePCList();
        }

        //Get currently selected character from TurnManagerScript.
        currentPCIndex = turnManager.currentPCIndex;
        currentPC      = turnManager.currentPC;

        //Snap camera to first index of pcList.
        cvc.m_Follow = currentPC.transform;
        cvc.m_LookAt = currentPC.transform;

        //Snaps camera dummy to same character
        cameraDummy.GetComponent <CinemachineVirtualCamera>().m_Follow = cvc.m_Follow;
        cameraDummy.GetComponent <CinemachineVirtualCamera>().m_LookAt = cvc.m_LookAt;

        //Give values to camera pan variables
        screenWidth  = Screen.width;
        screenHeight = Screen.height;

        //Camera pan speed
        camMoveSpeed = 20f;
    }
    // Use this for initialization
    void Start()
    {
        //Grab TurnManagerScript
        turnManager = GameObject.Find("TurnManager").GetComponent <TurnManagerScript>();

        // Grabs the NavMeshAgent of object.
        agent = GetComponent <NavMeshAgent>();

        // Grabs the enemy CharacterTemplate script
        charTemplate = GetComponent <CharacterTemplate>();

        // Gets the animator component.
        animator = gameObject.GetComponent <Animator>();

        // Sets the default state of isAlerted bool to false;
        isAlerted = false;

        // Grabs PC list from Turn Manager Script.
        pcList = turnManager.GetPCList();

        // Sets inAction to false by default.
        inAction = false;

        // Sets unitTurnOver to false;
        unitTurnOver = true;

        // Sets the enemy unit to alive status;
        isDead = false;

        // Sets state to none.
        currentState = UnitState.None;

        // Sets state of attack to false;
        hasAttacked = false;

        // Sets the movementRadius to a default value from character stat.
        // ** NEED TO CHANGE THIS ONCE ENEMY STAT SCRIPT IS COMPLETE **
        movementRadius = 8;
    }
Beispiel #18
0
    // Use this for initialization
    void Start()
    {
        mTurnManagerScript = GameManagerScript.GetInstance().GetComponent <TurnManagerScript>();
        mRestaurantScript  = GameManagerScript.GetInstance().GetComponent <RestaurantScript>();
        //players = GameManagerScript.sRestaurant.getAllPlayers();

        mUserButtonPrefab = Resources.Load <Button>("UserButton");

        mPlayerNamecards = new List <Button>();

        ShowUsername();
        //In the future we can add cool artwork here for each role and stuff.
        ShowRole();

        mDoneWithActionButton.onClick.AddListener(OnConfirmButtonClicked);

        mCourseTitle.text = mTurnManagerScript.mCurrentRound.ToString() + " ROUND";

        if (!showRolePanel)
        {
            mStartRoundPanel.gameObject.SetActive(true);
            mRolePanel.gameObject.SetActive(false);
            mActionPanel.gameObject.SetActive(false);
            mLazySusan.SetActive(false);
        }
        else
        {
            mStartRoundPanel.gameObject.SetActive(false);
            mRolePanel.gameObject.SetActive(true);
            mActionPanel.gameObject.SetActive(false);
            mLazySusan.SetActive(false);
        }

        mActionButtonLocation = mActionButton.transform.position;
        //PerformRoleAction();
    }
Beispiel #19
0
 // Use this for initialization
 void Start()
 {
     gameManager = GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <TurnManagerScript>();
 }
Beispiel #20
0
 void FindTurnMan()
 {
     turnMan = GameObject.FindGameObjectWithTag("Game Manager Local").GetComponent <TurnManagerScript> ();
 }
 public void setTurnMan(TurnManagerScript s)
 {
     tms = s;
 }
Beispiel #22
0
 void FindManager()
 {
     gameManager = GameObject.FindGameObjectWithTag("Game Manager Local");
     turnManager = gameManager.GetComponent <TurnManagerScript> ();
 }