コード例 #1
0
    void CmdSetShieldIdOnServer(GameObject obj)
    {
        Shield = obj;
        CustomNTC ntc = obj.GetComponent <CustomNTC>();

        ntc.parent         = transform;
        ntc.local_position = new Vector3(1f, 0, 0);
    }
コード例 #2
0
    public void CmdSetGun(GameObject g, int _level, uint _points, int _experience, int _next_level, int[] indeces)
    {
        Gun gun = g.GetComponent <Gun>();

        gun.RpcSetGun(_level, _points, _experience, _next_level, indeces);
        gun.client_user = this;
        CustomNTC ntc = gun.GetComponent <CustomNTC>();

        ntc.parent         = transform;
        ntc.local_position = new Vector3(0, 0, .8f);
    }
コード例 #3
0
    protected virtual void StartShieldBlocking()
    {
        blocking = true;
        Shield.GetComponent <Collider>().enabled = true;
        CustomNTC ntc = Shield.GetComponent <CustomNTC>();

        ntc.local_position        = new Vector3(0, 0, .5f);
        ntc.local_rotation_eulers = new Vector3(0, 90, 0);
        // Quaternion rot = Quaternion.AngleAxis(-90, Vector3.up);
        // Shield.transform.rotation *= rot;
        if (Gun)
        {
            /* Gun.transform.rotation *= rot;
             * Vector3 temp = Gun.transform.position;
             * Gun.transform.position = Shield.transform.position;
             * Shield.transform.position = temp;   */
            CustomNTC gun_ntc = Gun.GetComponent <CustomNTC>();
            gun_ntc.local_position        = new Vector3(1, 0, 0);
            gun_ntc.local_rotation_eulers = ntc.local_rotation_eulers;
        }
        speed = shield_speed;
    }