예제 #1
0
        protected void EditDecal()
        {
            Ray        ray = Camera.main.ViewportPointToRay(new Vector2(0.5f, 0.5f));
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 100.0f, LayerMask.GetMask(new string[2] {
                "Cell", "Water"
            })))
            {
                if (Input.GetKeyDown(KeyCode.R))
                {
                    if (_decalMaterial != null && _decalSprite != null)
                    {
                        Quaternion orientation = Quaternion.LookRotation(ray.direction, -Camera.main.transform.right);
                        GameObject newGo       = Instantiate(Resources.Load("Decal"), hit.point, orientation) as GameObject;
                        Decal      newDecal    = newGo.GetComponent <Decal>();
                        newDecal.Init(_decalSprite, _decalMaterial, _decalType, _decalName);
                    }
                }
            }
        }
예제 #2
0
        public static void Init()
        {
            Global.RealTime = 0.0;

            Trash.Rand_Init();
            CBuf.Init();
            Cmd.Init();
            CVar.Init();
            InitLocal();
            ClearSaveDirectory();
            Con.Init();
            HPAK.Init();

            SV.SetMaxClients();
            W.LoadWADFile();
            Decal.Init();
            Mod.Init();
            R.Init();
            NET.Init();
            Netchan.Init();
            Delta.Init();
            SV.Init();

            string buf = "asdasd"; // TODO

            CVar.DirectSet(ref Global.sv_version, buf);

            HPAK.CheckIntegrity("custom.hpk");
            CBuf.InsertText("exec valve.rc\n");
            Hunk.AllocName(0, "-HOST_HUNKLEVEL-");
            Global.HostHunkLevel = Hunk.LowMark;

            Global.HostActive    = 1;
            Global.HostNumFrames = 0;

            Global.HostTimes.Prev = Sys.FloatTime();
            Global.HostInit       = true;
        }