Esempio n. 1
0
    /// <
    /// summary>
    /// For unity eventTrigger
    ///
    /// </summary>
    private void PublicSpawnHelp()
    {
        if (hoverWindowMed == null)
        {
            hoverWindow    = FindObjectOfType <HoverWindow>();
            hoverWindowMed = FindObjectOfType <HoverWindowMed>();
        }

        if (hoverWindowMed == null)
        {
            return;
        }

        if (Category == Ca.Structure || Category == Ca.Shore || Category == Ca.Way ||
            //Category == Ca.Spawn ||
            HType == H.BuyRegion)
        {
            hoverWindow.ShowMsg(HType.ToString());
        }
        else if (HType == H.Person)
        {
            hoverWindow.ShowExplicitThis(Name);
        }
        //Construction Sign
        //bz if more than 6 he know how to build already
        else if (transform.name == "Construction" && BuildingPot.Control.Registro.AllBuilding.Count < 10)
        {
            hoverWindowMed.Show(MousePositionTowardsScreenCenter(), transform.name);
        }
        //Demolition Sign
        else if (transform.name == "Demolition")
        {
            hoverWindowMed.Show(MousePositionTowardsScreenCenter(), transform.name);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// Builds all the new Buildings .. The buildinga are loaded thue this method
    /// </summary>
    public void BuildNowNew(H buildWhat)
    {
        var state = BuildingPot.UnlockBuilds1.ReturnBuildingState(buildWhat);

        if (state != H.Unlock)
        {
            //todo
            Debug.Log("Sound here off negation of a building");
            return;
        }

        CleanCurrentSpawnBuildIfNewBuildIsADiffType(buildWhat);
        Vector3 iniPos = m.HitMouseOnTerrain.point;

        var onMap = CamControl.CAMRTS.MiniMapRts.IsOnMapConstraints(iniPos);

        iniPos = CamControl.CAMRTS.MiniMapRts.ConstrainLimits(iniPos);

        if (DefineCategory(buildWhat) == Ca.Structure || DefineCategory(buildWhat) == Ca.Shore)
        {
            BuildStructure(buildWhat, iniPos);

            if (buildWhat == H.Dock)
            {
                Program.gameScene.TutoStepCompleted("Dock.Tuto");
            }
        }
        else if (DefineCategory(buildWhat) == Ca.Way)
        {
            BuildWay(buildWhat, iniPos);
            CreateOrKillCursor();
        }
        else if (DefineCategory(buildWhat) == Ca.DraggableSquare)
        {
            BuildDragSquare(buildWhat, iniPos);
            CreateOrKillCursor();
        }

        DoingNow = buildWhat;

        AudioCollector.PlayOneShot("ClickWood7", 0);

        _hoverWindowMed = FindObjectOfType <HoverWindowMed>();

        if (Control.CurrentSpawnBuild.HType == H.BullDozer)
        {
            _hoverWindowMed.ShowSemiTut("BullDozer");
        }
        else if (Control.CurrentSpawnBuild.HType == H.Road && Control.Registro.DragSquares.Count < 4)
        {
            _hoverWindowMed.ShowSemiTut("Road");
        }
        else if (Control.Registro.AllBuilding.Count < 10)
        {
            _hoverWindowMed.ShowSemiTut("Build");
        }

        GameScene.ScreenPrint("Ready to build a " + buildWhat);
        InputMode = Mode.Placing;
    }
Esempio n. 3
0
    void Start()
    {
        oldMousePos = Input.mousePosition;
        timeStart   = Time.time;

        InputKeyMapping();
        _hoverWindowMed = FindObjectOfType <HoverWindowMed>();
    }
Esempio n. 4
0
 private void Start()
 {
     if (hoverWindowMed == null)
     {
         hoverWindow    = FindObjectOfType <HoverWindow>();
         hoverWindowMed = FindObjectOfType <HoverWindowMed>();
     }
 }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        _geometry = General.FindGameObjectInHierarchy("Geometry", gameObject);
        var textGO = General.FindGameObjectInHierarchy("Text", gameObject);

        if (textGO != null)
        {
            _text = textGO.GetComponent <Text>();
        }

        _hoverWindowMed = FindObjectOfType <HoverWindowMed>();
        _rectTransform  = transform.GetComponent <RectTransform>();
        Hide();
    }