Example #1
0
 private new void Awake()
 {
     timeCounter = GetComponent <TimerScript>();
     instance    = this;
     base.Awake();
     // PlayerScoreList = new Hashtable();
     foreach (var player in PhotonNetwork.PlayerList)
     {
         //PlayerScoreList.Add(player.NickName, 0);
         if (player.IsMasterClient)
         {
             //Hashtable hash = new Hashtable();
             //hash.Add("score", 0);
             //player.CustomProperties = hash;
             ScoreList.Add(player, 0);
         }
         else
         {
             //Hashtable hash = new Hashtable();
             //hash.Add("score", 100);
             //player.CustomProperties = hash;
             ScoreList.Add(player, 100);
         }
         Instantiate(roomListItemPrefab, ScoreBoardContent).GetComponent <ScoreBoardItem>().SetUp(player);
     }
 }
Example #2
0
    void Start()
    {
        rb             = GetComponent <Rigidbody>();
        playerNameText = GetComponentInChildren <Text>();
        gameManager    = GameObject.Find("Game Manager").GetComponent <MazeGameManager>();
        speed          = DEFAULT_SPEED;

        transform.position = new Vector3(-1.0f, 0.0f, 0.0f);

        cam = GameObject.Find("Main Camera");
        cam.GetComponent <CameraController>().AttachToPlayer(transform);
    }
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         Init();
     }
     mpb = new MaterialPropertyBlock();
     mpb.SetColor("_Color", Color.red);
 }
 public MazeIntroState(MazeGameManager game)
 {
     this.game = game;
 }
Example #5
0
 void Start()
 {
     _anim = GetComponentInChildren<Animator2D>();
     _controller = GetComponent<CharacterController>();
     _manager = GameObject.Find("GameManager").GetComponent<MazeGameManager>();
 }
Example #6
0
    void Start()
    {
        gameManager = GameObject.Find("Game Manager").GetComponent <MazeGameManager>();

        rotation = new Vector3(Random.Range(-90.0f, 90.0f), Random.Range(-90.0f, 90.0f), Random.Range(-90.0f, 90.0f));
    }