Наследование: MonoBehaviour
Пример #1
0
 public frmBasicSetup()
 {
     camControl = new CamControl();
     InitializeComponent();
     //获取摄像头设备
     RefreshCombo();
     if (frmLogin.UserLevel == 2)
     {
         gbSmsSettings.ForeColor = Color.FromArgb(250, 250, 250);
         groupBox1.ForeColor = Color.FromArgb(250, 250, 250);
         foreach (Control lbl in gbSmsSettings.Controls)
         {
             if (lbl is Label)
             {
                 lbl.ForeColor = Color.FromArgb(250, 250, 250);
             }
         }
         foreach (Control lbl in Controls)
         {
             if (lbl is Label)
             {
                 lbl.ForeColor = Color.FromArgb(250, 250, 250);
             }
         }
         this.llblContactYourAdministrator.LinkColor = Color.FromArgb(250, 250, 250);
         this.label3.ForeColor = Color.FromArgb(250, 250, 250);
         frmMainMenu mianColor = new frmMainMenu();
         this.btnSaveSetup.BackColor = mianColor.color4;
         this.btnDefault.BackColor = mianColor.color4;
         this.llblForgotPassword.LinkColor = Color.FromArgb(250, 250, 250);
         this.BackColor = mianColor.color3;
     }
 }
Пример #2
0
    public void EscapeKey()
    {
        //means is playing
        //&& Program.GameFullyLoaded() is to not allow touch ESC while is loadig
        if (!CamControl.IsMainMenuOn() && Program.GameFullyLoaded())
        {
            if (Program.MouseListener.IsAWindowShownNow())
            {
                Program.MouseListener.HidePersonBuildOrderNotiBulletinHelpWin();
                return;
            }

            CamControl.ChangeTo("Main");

            Program.gameScene.PauseGameSpeed();

            Program.MouseListener.HideMainGUI();
            Program.MyScreen1.LoadMainMenuWithResumeBtn();

            CamControl.CAMRTS.StopReportingAudioNow();
        }
        //is on main Menu
        else if (CamControl.IsMainMenuOn() && Program.GameFullyLoaded())
        {
            CamControl.ChangeTo("Game");

            Program.gameScene.ResumeGameSpeed();

            Program.MyScreen1.DestroyCurrentMenu();
            Program.MouseListener.ShowMainGUI();

            CamControl.CAMRTS.ReportAudioNow();
        }
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
//		StartCoroutine (Shoot ());
        rb     = GetComponent <Rigidbody2D>();
        cam    = GameObject.Find("Main Camera").GetComponent <CamControl> ();
        player = GameObject.Find("Raven Player");
    }
Пример #4
0
    public void StartGame()
    {
//		orders          = gameObject.AddComponent<Orders>();
        Debug.Log("switching on UI");
        ui = gameObject.AddComponent <UI>();
        GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>().enabled     = true;
        GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CamControl>().enabled = true;

        ui.gameLoadedSummaryWindow = true;
        //
        camControls = Camera.main.transform.GetComponent <CamControl>();

        // update lists of chits and controllers
        for (int f = 0; f < factions.Count; f++)
        {
            factions[f].UpdateListOfChits();
            factions[f].UpdateListOfControllers();
        }


        currentChar             = playerFaction.controllers[playerFaction.step];
        currentChar.remainingCR = currentChar.commandRating;

        numberOfFactions = factions.Count;

        int tileID = currentChar.GetComponent <Chit>().tile.id;

        // Get the ActiveRegionHoop, and set it up
        activeRegionHoop = (GameObject)GameObject.Find("ActiveRegionHoop");
        activeRegionHoop.GetComponent <ActiveRegionHoop>().setPlanet(this);
        SetActiveTiles(tileID);
    }
Пример #5
0
    public static Sound PlaySoundOneTime(string soundToPlayRoot, Vector3 iniPos = new Vector3(), Transform container = null)
    {
        return(null);

        CamControl mainCam = USearch.FindCurrentCamera();
        Sound      temp    = null;

        if (Settings.ISSoundOn)
        {
            if (iniPos == Vector3.zero)
            {
                iniPos = mainCam.transform.GetComponent <Camera>().transform.position;
            }
            temp = (Sound)General.Create(soundToPlayRoot, iniPos);
        }

        if (container == null)
        {
            temp.transform.SetParent(mainCam.transform.GetComponent <Camera>().transform);
        }
        else
        {
            temp.transform.SetParent(container);
        }

        return(temp);
    }
Пример #6
0
        protected override void Update(GameTime gameTime)
        {
            CurrentGameTime = gameTime;

            InputKeyboard.UpdateState();
            InputMouse.UpdateState();

            if (InputKeyboard.KeyNowPressed(Keys.I))
            {
                StatusText.DrawStatus = !StatusText.DrawStatus;
            }

            if (InputKeyboard.KeyNowPressed(Keys.H))
            {
                StatusText.DrawControls = !StatusText.DrawControls;
            }

            StatusText.Update();

            ManipulationMenu.Update();

            if (Pause)
            {
                PausedActions();
            }
            else
            {
                RunningActions();
            }

            CamControl.Update();
        }
Пример #7
0
    /// <summary>
    /// Will destroy current form and will load loading screebn
    /// </summary>
    public void DestroyCurrLoadLoading()
    {
        CamControl.ChangeTo("Game");

        current.Destroy();
        LoadLoadingScreen();
    }
Пример #8
0
    private MyForm main;//the main GUI
    public void LoadMainGUI()
    {
        if (main == null)
        {
            main = (MyForm)Create(Root.mainGUI, new Vector2());
        }

        //can only be one on scene to work
        _buildingsMenu      = FindObjectOfType <BuildingsMenu>();
        _descriptionWindow  = FindObjectOfType <DescriptionWindow>();
        _personWindow       = FindObjectOfType <PersonWindow>();
        _buildingWindow     = FindObjectOfType <BuildingWindow>();
        _addOrderWindow     = FindObjectOfType <AddOrderWindow>();
        _notificationWindow = FindObjectOfType <NotificationWindowGO>();

        BulletinWindow = FindObjectOfType <BulletinWindow>();
        QuestWindow    = FindObjectOfType <QuestWindow>();
        _helpWindow    = FindObjectOfType <HelpWindow>();
        TutoWindow1    = FindObjectOfType <TutoWindow>();


        //Debug.Log("LoadMainGUI() GUI");

        if (CamControl.IsMainMenuOn())
        {
            HideMainGUI();
        }
    }
Пример #9
0
        public void OnFrame()
        {
            Dispatcher.ProcessFrame();

            CamControl.Update(ActiveCamera, State != AppState.World);

            EditManager.Instance.UpdateChanges();

            // do not move before mCamControl.Update to have the latest view/projection
            if (State == AppState.World)
            {
                UpdateCursorPosition();
                UpdateBrushTime(TimeManager.Instance.GetTime());
                CheckUpdateGlobalBuffer();
            }

            GraphicsContext.Context.VertexShader.SetConstantBuffer(0, mGlobalBuffer.Native);
            GraphicsContext.Context.PixelShader.SetConstantBuffer(0, mGlobalBuffer.Native);

            MapManager.OnFrame(ActiveCamera);

            if (!HideWMO)
            {
                WmoManager.OnFrame(ActiveCamera);
            }

            if (!HideM2)
            {
                M2Manager.OnFrame(ActiveCamera);
            }

            WorldTextManager.OnFrame(ActiveCamera);
            BoundingBoxDrawManager.OnFrame();
        }
Пример #10
0
    public void Update()
    {
        if (Program.MouseListener.IsAWindowShownNow() || CamControl.IsMainMenuOn() || _lastCompleted < 0)
        {
            return;
        }

        if (Program.gameScene.IsPassingTheTutoNow())
        {
            return;
        }

        //to show  others  and loaded
        if (Time.time > _lastCompleted + _timeToNextQuest)
        {
            if (Dialog.IsActive() || BuildingPot.Control.CurrentSpawnBuild != null)
            {
                //so goes trhu again in 30s
                _lastCompleted = Time.time - 60;
                return;
            }

            if (_currentQuests.Count == 0)
            {
                AddANewQuest();
            }
            else
            {
                ShowQuestBtn();
            }
        }
    }
Пример #11
0
    public void Awake()
    {
        interactionManager = FindObjectOfType <InteractionManager>();

        tilemesh        = GetChildren("tile")[0].gameObject;
        meshRenderer    = tilemesh.GetComponent <Renderer>();
        anchorCount     = GetCount("anchor");
        connectorCount  = GetCount("connector");
        connectorOffset = new Vector3[connectorCount];

        int c = 0;

        for (int i = 0; i < transform.childCount; i++)
        {
            Transform child = transform.GetChild(i);

            if (child.name.Contains("connector"))
            {
                //calculate LOCAL offsets to each connector
                //connectorOffset[c++] = child.localPosition - Vector3.zero;
                connectorOffset[c++] = child.position - transform.position;
            }
        }

        exploreToken = transform.Find("Exploration Token").transform;
        exploreToken.localPosition = new Vector3(exploreToken.localPosition.x, 2, exploreToken.localPosition.z);
        exploreToken.gameObject.SetActive(false);

        meshRenderer.material.SetFloat("_sepiaValue", 1);

        triggerManager = FindObjectOfType <TriggerManager>();
        camControl     = FindObjectOfType <CamControl>();
        //StartCoroutine( Wait1Frame() );
    }
Пример #12
0
    /// <summary>
    /// Load terrain and water
    /// </summary>
    /// <param name="terrainRoot"></param>
    public void LoadTerrain()
    {
        Debug.Log("LoadTerrain:" + Time.time);
        //bz music
        CamControl.CreateCam(H.CamRTS);

        if (string.IsNullOrEmpty(Program.MyScreen1.TerraRoot))
        {
            //the default terrain
            Terreno = Terreno.CreateTerrain(Root.bayAndMountain1River, true);
        }
        else
        {
            //will create cvamera if is null
            Terreno = Terreno.CreateTerrain(Program.MyScreen1.TerraRoot);
        }

        if (WaterBody == null)
        {
            //at the Moment Water Small is not visible Apr1 2016. since the mirror was duplicating
            //the Draw calls
            _waterBody = General.Create(Root.waterSmall, new Vector3(0, 8, 0));
        }
        controllerMain = Create(Root.controllerMain, container: Program.ClassContainer.transform) as ControllerMain;
        Debug.Log("LoadTerrain:" + Time.time);
    }
Пример #13
0
    // Update is called once per frame
    //void LateUpdate()
    private void Update()
    {
        if (Program.MouseListener.IsAWindowScrollableShownNow() || CamControl.IsMainMenuOn() ||
            ScrollViewShowInventory.IsMouseOnMe || Program.IsMouseOnScrollableContent)
        {
            return;
        }

        //initiales current obj pos and rot to...
        InitializeObjects();
        CreateTargetAndUpdate();

        if (!Program.IsInputLocked &&
            U2D.IsMouseOnScreen() &&
            !MiniMapRTS.isOnTheLimits && BuildingPot.Control != null && BuildingPot.Control.Registro.AllBuilding.Count > 0)
        {
            ControlInput();
            MouseInBorderDealer();
        }

        AlignYInZero();

        RotateScript();
        rotateRTS.Update();

        //CameraFOV();
    }
Пример #14
0
        public frmCodeScann()
        {
            camControl = new CamControl();
            InitializeComponent();
            barcodeReader = new BarcodeReader
            {
                AutoRotate  = true,
                TryInverted = true,
                Options     = new DecodingOptions {
                    TryHarder = true
                }
            };
            barcodeReader.ResultPointFound += point =>
            {
                if (point == null)
                {
                    resultPoints.Clear();
                }
                else
                {
                    resultPoints.Add(point);
                }
            };

            resultPoints = new List <ResultPoint>();
            lastResults  = new List <Result>();
            Renderer     = typeof(BitmapRenderer);

            if (frmLogin.UserLevel == 2)
            {
                frmMainMenu mianColor = new frmMainMenu();
                this.BackColor = mianColor.color3;
            }
        }
Пример #15
0
 // Use this for initialization
 void Start()
 {
     rb              = GetComponent <Rigidbody2D>();
     deathCounter    = GameObject.Find("Manager").GetComponent <GameManager> ();
     player          = GameObject.Find("Raven Player");
     cam             = GameObject.Find("Main Camera").GetComponent <CamControl> ();
     currentTimeBABY = timer;
 }
Пример #16
0
    public static CamControl Create(string root, Vector3 origen = new Vector3())
    {
        CamControl obj = null;

        obj = (CamControl)Resources.Load(root, typeof(CamControl));
        obj = (CamControl)Instantiate(obj, origen, Quaternion.identity);
        return(obj);
    }
Пример #17
0
    /// <summary>
    /// Load the main menu
    /// </summary>
    public void LoadMainMenu()
    {
        current      = (MyForm)General.Create(Root.mainMenu, new Vector2());
        mainMenuForm = current;
        CamControl.ChangeTo("Main");

        Debug.Log("Load Main Menu");
    }
Пример #18
0
    // Use this for initialization
    void Start()
    {
        rb       = GetComponent <Rigidbody2D> ();
        box      = GetComponent <BoxCollider2D> ();
        debugPts = new Vector2[2];

        cam = GameObject.Find("Main Camera").GetComponent <CamControl> ();
        //timeAlive = 0;
    }
Пример #19
0
    // Use this for initialization
    void Start()
    {
//		StartCoroutine (Shoot ());
        rb           = GetComponent <Rigidbody2D>();
        deathCounter = GameObject.Find("Manager").GetComponent <GameManager> ();
        player       = GameObject.Find("Raven Player");
        dashToo      = playerMove.GetComponent <playerMovement> ().isDashing;
        cam          = GameObject.Find("Main Camera").GetComponent <CamControl> ();
    }
Пример #20
0
    // Use this for initialization
    private void Start()
    {
        iniTransf = transform;
        mainCam   = USearch.FindCurrentCamera();

        if (isToKeepDistanceFromCamAndRotateLikeChild)
        {
            difference = mainCam.transform.position - transform.position;
        }
    }
Пример #21
0
 private void Awake()
 {
     if (me != null)
     {
         Destroy(gameObject);
         return;
     }
     me         = this;
     defaultPos = transform.position;
 }
Пример #22
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this);
     }
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #23
0
    // Update is called once per frame
    void Update()
    {
        if (KeepTransform != null && _rectTransform != null)
        {
            _rectTransform.position = CamControl.RTSCamera().WorldToScreenPoint(KeepTransform.position);
        }

        if (MyBuilding == null || MyBuilding.PositionFixed)
        {
            Destroy(gameObject);
        }
    }
Пример #24
0
    // Use this for initialization
    void Start()
    {
        GameObject.Find ("sim").GetComponent<BoxCollider2D>().enabled = false;
        GameObject.Find ("nao").GetComponent<BoxCollider2D>().enabled = false;

        timer[3] = 5f;
        start = false;
        cmt_plr = GameObject.FindGameObjectWithTag("Player").GetComponent<ComunicationAndStatusPlayer>();
        plr_mov = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMove>();
        npc_mov = GameObject.Find("NPCF").GetComponent<NPCMove>();
        cam = GameObject.Find ("Main Camera").GetComponent<CamControl> ();
        cam_size = GameObject.Find ("Main Camera").GetComponent<Camera> ();
    }
Пример #25
0
    static private void LoadAllAudios()
    {
        if (_soundsLib.Count > 0)
        {
            return;
        }

        soundsCointaner = General.Create(Root.classesContainer, CamControl.CurrentCamera().transform.position,
                                         "SoundContainer", CamControl.CurrentCamera().transform);

        //starts the music
        MusicManager.Start();
    }
Пример #26
0
    protected void OnMouseEnter()
    {
        //so dont show on top of other while placing a building
        if (BuildingPot.InputMode == Mode.Placing)
        {
            return;
        }
        if (Program.MouseListener.IsAWindowShownNow() || CamControl.IsMainMenuOn())
        {
            return;
        }

        PublicSpawnHelp();
    }
Пример #27
0
    private void Awake()
    {
        if (null == cam)
        {
            cam = FindObjectOfType <CamControl>();
        }

        playerPrefab = AlternateAssets.GetPrefab("Player");

        //if (null == camAssist)
        //{
        //    camAssist = FindObjectOfType<CamControlEZ>();
        //}
    }
Пример #28
0
 // Update is called once per frame
 new internal void Update()
 {
     if (isToFollowCamera)
     {
         if (Camera.main != null)
         {
             transform.position = Camera.main.transform.position;
         }
         else
         {
             mainCamera         = USearch.FindCurrentCamera();
             transform.position = mainCamera.transform.position;
         }
     }
 }
Пример #29
0
Файл: UPoly.cs Проект: Cdrix/SM
    /// <summary>
    /// Will ray cast to all obj from active camera will ret the raycast
    /// </summary>
    /// <param name="screenPoint"></param>
    /// <returns></returns>
    public static RaycastHit RayCastAll(Vector2 screenPoint)
    {
        CamControl mainCam  = USearch.FindCurrentCamera();
        RaycastHit HitMouse = new RaycastHit();

        if (Physics.Raycast(mainCam.transform.GetComponent <Camera>().ScreenPointToRay(screenPoint), out HitMouse,
                            Mathf.Infinity))
        {
        }
        else
        {
            //Debug.Log("Mouse Did not Hit any obj UPoly.cs");
        }
        return(HitMouse);
    }
Пример #30
0
Файл: UPoly.cs Проект: Cdrix/SM
    /// <summary>
    /// Will ray cast to layer , from active camera will ret the raycast
    /// </summary>
    /// <param name="screenPoint"></param>
    /// <returns></returns>
    public static RaycastHit RayCastLayer(Vector2 screenPoint, int layerNumb)
    {
        CamControl mainCam  = USearch.FindCurrentCamera();
        RaycastHit HitMouse = new RaycastHit();

        int layerMask = 1 << layerNumb;

        if (Physics.Raycast(mainCam.transform.GetComponent <Camera>().ScreenPointToRay(screenPoint), out HitMouse,
                            Mathf.Infinity, layerMask))
        {
        }
        else
        {
            //Debug.Log("Mouse Did not Hit Layer:"+layerNumb);
        }
        return(HitMouse);
    }
Пример #31
0
    public static CamControl FindCurrentCamera()
    {
        CamControl cc = new CamControl();

        if (CamControl.CAMFollow != null)
        {
            cc = CamControl.CAMFollow;
        }
        //else if (CamControl.CAMFPS != null)
        //{
        //    print("CAMFPS doesnt inherit from CAMControl");
        //}
        else if (CamControl.CAMRTS != null)
        {
            cc = CamControl.CAMRTS;
        }
        return(cc);
    }
Пример #32
0
	// Use this for initialization
	void Start () {
        cam = Camera.main.GetComponent<CamControl>();
        camInitPos = cam.transform.position;

        nodes = new List<Node>();
        connections = new List<Connection>();
        focusConnections = new List<Connection>();

        nodeContainer = transform.FindChild("nodes");
        connectionContainer = transform.FindChild("connections");

        for (int i = 0; i < numStartNodes; i++)
        {
            addNode();
        }

		OSCMaster.init ();
        OSCMaster.neuronPulseReceived += neuronPulseReceived;
        OSCMaster.neuronZoomReceived += neuronZoomReceived;
        OSCMaster.nodeSizeReceived += nodeSizeReceived;
	}
Пример #33
0
 // Use this for initialization
 void Start()
 {
     plr_mov = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerMove> ();
     plr_cmt = GameObject.FindGameObjectWithTag ("Player").GetComponent<ComunicationAndStatusPlayer> ();
     cam = GameObject.Find ("Main Camera").GetComponent<CamControl> ();
 }
Пример #34
0
    void Start()
    {
        Debug.Log ("switching on Turn");
        camControls = Camera.main.transform.GetComponent<CamControl>();
        planet = GameObject.Find("Planet").GetComponent<Planet>();

        // Get the ActiveRegionHoop, and set it up
        activeRegionHoop = (GameObject)GameObject.Find("ActiveRegionHoop");
        activeRegionHoop.GetComponent<ActiveRegionHoop>().setPlanet(planet);

        //		planet.turn = this;
        numFactions = planet.factions.Count;

        // randomly pick who gets first turn
        currentFctr = Random.Range(0, numFactions);

        planet.factions[currentFctr].cycle++;

        //	UpdateTurn();
    }
Пример #35
0
    public void StartGame()
    {
        //		orders 			= gameObject.AddComponent<Orders>();
        Debug.Log("switching on UI");
        ui = gameObject.AddComponent<UI>();
        GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>().enabled = true;
        GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CamControl>().enabled = true;

        ui.gameLoadedSummaryWindow = true;
        //
        camControls 	= Camera.main.transform.GetComponent<CamControl>();

        // update lists of chits and controllers
        for (int f=0; f<factions.Count; f++)
        {
            factions[f].UpdateListOfChits();
            factions[f].UpdateListOfControllers();
        }

        currentChar 			= playerFaction.controllers[playerFaction.step];
        currentChar.remainingCR = currentChar.commandRating;

        numberOfFactions = factions.Count;

        int tileID = currentChar.GetComponent<Chit>().tile.id;
        // Get the ActiveRegionHoop, and set it up
        activeRegionHoop = (GameObject)GameObject.Find("ActiveRegionHoop");
        activeRegionHoop.GetComponent<ActiveRegionHoop>().setPlanet(this);
        SetActiveTiles(tileID);
    }
    // Use this for initialization
    void Start()
    {
        // Inicializando Valor Das Variaveis Publicas Somente Para Comunicaçao (assim evitando erros)
        comunication = false;
        start_dial = false;

        // cores
        this.gameObject.GetComponent<SpriteRenderer> ().color = new Color (Random.Range(0,1f),Random.Range(0,1f),Random.Range(0,1f));

        // Importanto Componentes (<Scripts>,<SpriteRenderer>)
        plr_spr = GameObject.FindGameObjectWithTag("plr_bln").GetComponent<SpriteRenderer>();
        plr_bln = GameObject.FindGameObjectWithTag("Player").GetComponent<ComunicationAndStatusPlayer>();
        plr_mov = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMove>();
        cntrl = GameObject.Find("Main Camera").GetComponent<CamControl>();
        kpt_cool = GameObject.FindGameObjectWithTag("Player").GetComponent<KeepinItCool>();
        //anima = GetComponent<NPCAnim>();
    }