示例#1
0
    public void MaybeJumpOrFall(Actor ne, CcNet net)
    {
        if (grounded)
        {
            yMove = 0f;

            if (CcInput.Started(UserAction.MoveUp) || JumpBoosted)
            {
                yMove = JumpBoosted ? 7f : 4f;

                if /****/ (JumpBoosted)
                {
                    ne.PlaySound("spacey");
                }
                else
                {
                    ne.PlaySound("Jump");
                }

                net.SendTINYUserUpdate(ne.User.viewID, UserAction.MoveUp);
                // FIXME: this makes remote players play normal jump sound even when bouncepadding
            }
        }
        else           // we're in the air
        {
            yMove -= Time.deltaTime * net.CurrMatch.Gravity;
        }
    }
示例#2
0
    void Start()
    {
        matchSetup.Init();

        // scripts
        net      = GetComponent <CcNet>();
        Log      = GetComponent <CcLog>();
        arse     = GetComponent <Arsenal>();
        controls = GetComponent <Controls>();
        locUser  = GetComponent <LocalUser>();

        // make local user
        net.LocEnt          = new NetEntity();
        net.LocEnt.local    = true;
        net.LocEnt.name     = PlayerPrefs.GetString("PlayerName", defaultName);
        net.LocEnt.headType = PlayerPrefs.GetInt("PlayerHead", 0);
        net.LocEnt.colA.r   = PlayerPrefs.GetFloat("PlayerColA_R", Color.yellow.r);
        net.LocEnt.colA.g   = PlayerPrefs.GetFloat("PlayerColA_G", Color.yellow.g);
        net.LocEnt.colA.b   = PlayerPrefs.GetFloat("PlayerColA_B", Color.yellow.b);
        net.LocEnt.colA.a   = 1;
        net.LocEnt.colB.r   = PlayerPrefs.GetFloat("PlayerColB_R", Color.green.r);
        net.LocEnt.colB.g   = PlayerPrefs.GetFloat("PlayerColB_G", Color.green.g);
        net.LocEnt.colB.b   = PlayerPrefs.GetFloat("PlayerColB_B", Color.green.b);
        net.LocEnt.colB.a   = 1;
        net.LocEnt.colC.r   = PlayerPrefs.GetFloat("PlayerColC_R", Color.cyan.r);
        net.LocEnt.colC.g   = PlayerPrefs.GetFloat("PlayerColC_G", Color.cyan.g);
        net.LocEnt.colC.b   = PlayerPrefs.GetFloat("PlayerColC_B", Color.cyan.b);
        net.LocEnt.colC.a   = 1;

        // load settings
        Log.FadeTime     = PlayerPrefs.GetFloat("textFadeTime", 10f);
        net.gunBobbing   = PlayerPrefs.GetInt("GunBobbing", 1) == 1;
        Sfx.VolumeMaster = PlayerPrefs.GetFloat("MasterVolume", 1f);
        S.Hud            = this;
    }
示例#3
0
    Vector3 oobGunOffs = new Vector3(0.074f, 0.46f, 0.84f);     // offset of gun from aimBone (out of body view)



    void Start()
    {
        // components
        if (bod == null)
        {
            bod = gameObject.AddComponent <CcBody>();
        }

        // get
        cc = GetComponent <CharacterController>();
        var o = GameObject.Find("Main Program");

        net     = o.GetComponent <CcNet>();
        hud     = o.GetComponent <Hud>();
        arse    = o.GetComponent <Arsenal>();
        locUser = o.GetComponent <LocalUser>();

        // new female model
        //Model = (GameObject)GameObject.Instantiate(Models.Get("Mia"));
        //Model.SetActive(true);
        //Model.hideFlags = HideFlags.None;    //.DontSave; // ....to the scene. AND don't DESTROY when new scene loads



        // the rest is all dependent on User class
        if (User == null)
        {
            return;
        }

        if (User.local && net.CurrMatch.pitchBlack)
        {
            Camera.main.backgroundColor = Color.black;
            RenderSettings.ambientLight = Color.black;
        }

        if (User.lives >= 0)
        {
            if (User.local)
            {
                SetModelVisibility(false);
            }
            else
            {
                SetModelVisibility(true);
            }

            Respawn();
        }
        else
        {
            // we joined as a spectator
            SetModelVisibility(false);
            transform.position = -Vector3.up * 99f;
        }

        // get rid of gun1 and gun2 builtin to the avatar
        MeshInHand.GetComponent <Renderer>().enabled = false;
        MeshInHand.SetActive(false);
        MeshOnBack.SetActive(false);
        MeshOnBack.GetComponent <Renderer>().enabled = false;
    }
示例#4
0
 void Start()
 {
     net = GameObject.Find("Main Program").GetComponent <CcNet>();
     ResetBall();
 }
示例#5
0
 void Start()
 {
     net = GetComponent <CcNet>();
     hud = GetComponent <Hud>();
 }