Inheritance: MonoBehaviour
Esempio n. 1
0
 void Awake()
 {
     GameInfo.gi.player = gameObject;
     teleportScript     = GetComponent <PlayerTeleport>();
     startPosition      = transform.position;
     startRotation      = transform.rotation;
 }
    private Vector3 memoryPosition;    // 引く時のPositionを

    private void Start()
    {
        input          = new PlayerInput();
        move           = new PlayerTeleport();
        drawLine       = new DrawLine(line);
        rope           = new DrawrRope(line);
        pull           = new ControllerPull();
        cursorFunction = new CursorPosition();
        runaway        = new PlayerRunaway();
        anchorAction   = new AnchorShoot();
        postProcess    = eye.GetComponent <PostProcessingBehaviour>();
        cameraFade     = new CameraFade();
        playerMap      = new PlayerMap( );
        lineMt         = line.GetComponent <Renderer>().material;

        banCurcor.SetActive(false);
        cursor = pointCursor;

        goleMapSwitch = true;

        arrowCursor.SetActive(false);

        hibana.gameObject.SetActive(false);

        pullBody.SetActive(false);
        map.SetActive(false);
        particle.SetActive(false);

        viveDevice = SteamVR_Controller.Input((int)viveRightController.GetComponent <SteamVR_RenderModel>().index);
        fadeMt     = fadeObject.GetComponent <MeshRenderer>().material;
        FadeInStart();
    }
Esempio n. 3
0
        public static PlayerTeleport read(BinaryReader binaryReader)
        {
            PlayerTeleport newObj = new PlayerTeleport();

            newObj.physics_timestamp = binaryReader.ReadUInt16();
            Util.readToAlign(binaryReader);
            return(newObj);
        }
    private void Start()
    {
        states     = GetComponent <PlayerStates>();
        checkpoint = GetComponent <PlayerCheckpoint>();
        teleport   = GetComponent <PlayerTeleport>();
        movement   = GetComponent <Movement>();

        cam           = Camera.main;
        camController = cam.GetComponent <CameraController>();

        currentHealth   = maxHealth;
        healthText.text = "Health: " + currentHealth;
    }
    void Start()
    {
        states     = GetComponent <PlayerStates>();
        spawnDecoy = GetComponent <PlayerSpawnDecoy>();
        spawnBlock = GetComponent <PlayerSpawnBlock>();
        teleport   = GetComponent <PlayerTeleport>();
        wallGrab   = GetComponent <PlayerWallGrab>();
        slide      = GetComponent <PlayerSlide>();
        movement   = GetComponent <Movement>();
        possession = GetComponent <PlayerPossession>();

        dontGrabWallTimer    = 0;
        possessionInputTimer = possessionInputDelay;
    }
Esempio n. 6
0
    void Start()
    {
        playerTeleport = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerTeleport>();

        bool valueCheck = nextLevel == "" ||
                          maxTeleports <= 0 ||
                          maxScore <= 0 ||
                          SceneManager.GetSceneByName(nextLevel).IsValid() ||
                          playerTeleport == null;

        if (valueCheck)
        {
            Debug.LogError("Invalid value entered.");
        }
    }
Esempio n. 7
0
        public void RefreshLocation()
        {
            if (!LogInComplete)
            {
                _client.Bot.OnErrorMessage("Protocol violation: Location refresh before logged in.");
                return;
            }

            var tp = new PlayerTeleport {
                Location = _thisEntity.Position,
                Yaw      = _thisEntity.Yaw,
                Pitch    = _thisEntity.Pitch,
                PlayerId = -1
            };

            _client.SendPacket(tp);
        }
    // Use this for initialization
    void Start()
    {
        teleport           = GetComponent <PlayerTeleport>();
        midiPlayer         = GetComponent <MIDIPlayer>();
        magicBallGenerator = GetComponent <MagicBallGenerator>();

        availableNotes = Configuration.availableNotes;

        // Set available notes
        if (magicBallGenerator != null && availableNotes != null)
        {
            magicBallGenerator.SetAvailableIndex(availableNotes);
        }

        projectileManager = GameObject.FindGameObjectWithTag("Terrain").GetComponent <ProjectileManager>();  // Get Projectile manager

        currentCamera = GetCameraObject();
    }
Esempio n. 9
0
        /// <summary>
        /// Handle a client moving.
        /// </summary>
        /// <param name="entity"></param>
        private void SomeoneMoved(Entity entity)
        {
            var t = new PlayerTeleport { // -- It's less math and hassle to just send a teleport instead of anything else.
                Location = entity.Location.Location,
                Pitch    = entity.Location.Look,
                PlayerId = entity.ClientId,
                Yaw      = entity.Location.Rotation
            };

            if (entity == Entity && entity.SendOwn)
            {
                t.PlayerId = -1;
            }
            else if (entity == Entity && !entity.SendOwn)
            {
                return;
            }

            _client.SendPacket(t);
        }