示例#1
0
 void Awake()
 {
     parentTrans      = transform.parent;
     CC               = parentTrans.GetComponent <CharacterController>();
     playerInfo       = parentTrans.GetComponent <TP_Info>();
     playerMotor      = parentTrans.GetComponent <TP_Motor>();
     roomMenu         = GameObject.FindGameObjectWithTag("RoomMenu").GetComponent <InRoom_Menu>();
     myPhotonView     = transform.parent.GetComponent <PhotonView>();
     _lockAttackCheck = false;
     attackDistance   = 100;
 }
示例#2
0
    void Start()
    {
        //Screen.lockCursor = true;
        //Screen.showCursor = false;

        roomMenu = GameObject.FindGameObjectWithTag("RoomMenu").GetComponent <InRoom_Menu>();

        //Clamped
        Distance      = Mathf.Clamp(Distance, DistanceMin, DistanceMax);
        startDistance = Distance;
        Reset();
    }
示例#3
0
    void Awake()
    {
        DontDestroyOnLoad(gameObject);
        SP = this;
        PhotonNetwork.isMessageQueueRunning = true;
        WholeGameManager.SP.InGame          = true;
        InRoomChat.SP.OnGameAlignment();
        _setAllPlayerInfoID = false;
        _roomMenuScript     = GameObject.Find("RoomMenu").GetComponent <InRoom_Menu>();

        #region error Detection
        //if can't find Room_Menu, it must be wrong cuz it should not be destroy when loading the game scene
        if (_roomMenuScript == null)
        {
            Debug.LogError("Can't Find PlayerList");
            WholeGameManager.SP.InGame = false;
            Application.LoadLevel("Lobby-Scene");
            return;
        }

        // in case we started this demo with the wrong scene being active, simply load the menu scene
        if (!PhotonNetwork.connected)
        {
            WholeGameManager.SP.NameExisted = false;
            WholeGameManager.SP.InGame      = false;
            Application.LoadLevel("Lobby-Scene");
            return;
        }
        #endregion

        if (_myGameState != GameState.OverView)
        {
            if (PhotonNetwork.isMasterClient)
            {
                _roomMenuScript.AllocateAndSpawnMonster();
                //_roomMenuScript.SpawnAI();
            }

            _roomMenuScript.SpawnPlayer();

            if (PhotonNetwork.isMasterClient)
            {
                ismaster = true;
                InRoom_Menu.SP.AssignTeamNumInput();
                InvokeRepeating("AddAllPlayerMoney", 5f, 1f);
            }

            _myGameState = GameState.Playing;
        }
    }
示例#4
0
    void Awake()
    {
        IsRunning           = true;
        CharacterController = GetComponent("CharacterController") as CharacterController;
        playerAnimator      = GetComponent <TP_Animator>();
        playerMotor         = GetComponent <TP_Motor>();
        playerInfo          = GetComponent <TP_Info>();
        roomMenu            = GameObject.FindGameObjectWithTag("RoomMenu").GetComponent <InRoom_Menu>();

        myPhotonView = GetComponent <PhotonView>();
        Instance     = this;

        UselightSourceTimer = 0;

        buffSkillType = new TP_Animator.BuffSkillType[2];
    }