コード例 #1
0
    private void OnTriggerEnter(Collider other)
    {
        PlayerGunControl playerGunControl = other.GetComponentInChildren <PlayerGunControl>();

        if (playerGunControl)
        {
            playerGunControl.PickupWeapon(m_weaponType);
            Destroy(gameObject);
        }
    }
コード例 #2
0
    public void SetBulletVars(string type, string bulletId, string playerId, PlayerGunControl gunControl)
    {
        _gunControl = gunControl;
        GunSettings gunInfo = GunLocker.singleton.GetGunInfo(type);

        BulletId             = bulletId;
        PlayerId             = playerId;
        damage               = gunInfo.damage;
        gameObject.name      = bulletId;
        bulletSpeed          = gunInfo.bulletSpeed;
        physicsHitMultiplier = gunInfo.physicsHitMultiplier;
    }
コード例 #3
0
    private void Awake()
    {
        _smoothSync     = gameObject.GetComponent <SmoothSync>();
        _gunControl     = gameObject.GetComponent <PlayerGunControl>();
        rigidbody       = gameObject.GetComponent <Rigidbody>();
        _networkManager = gameObject.GetComponent <PlayerNetworkManager>();
        renderer        = gameObject.GetComponentInChildren <Renderer>();
        baseMaterial    = renderer.material;
        cam             = Camera.main;

        footstep = footstepTimer;
    }
コード例 #4
0
    public void Setup()
    {
        m_Movement         = m_Instance.GetComponent <PlayerMovement>();
        m_GunControl       = m_Instance.GetComponentInChildren <PlayerGunControl>();
        m_CanvasGameObject = m_Instance.GetComponentInChildren <Canvas>().gameObject;

        m_Movement.m_PlayerNumber   = m_PlayerNumber;
        m_GunControl.m_playerNumber = m_PlayerNumber;

        m_ColoredPlayerText = "<color=#" + ColorUtility.ToHtmlStringRGB(m_PlayerColor) + ">PLAYER " + m_PlayerNumber + "</color>";

        MeshRenderer[] renderers = m_Instance.GetComponentsInChildren <MeshRenderer>();

        for (int i = 0; i < renderers.Length; i++)
        {
            renderers[i].material.color = m_PlayerColor;
        }
    }