Esempio n. 1
0
 private void SetTileSprite(FloorManager floor, Sprite sprite, int row, int column)
 {
     floor.GetTileAtPosition(row, column)
     .GetComponentInChildren <Path>(true)
     .GetComponentInChildren <SpriteRenderer>(true)
     .sprite = sprite;
 }
    private void OnSceneGUI()
    {
        GUIStyle Style = new GUIStyle()
        {
            normal = new GUIStyleState()
            {
                textColor = Color.white
            },
            fontSize = 18
        };
        FloorManager floorManager = (FloorManager)target;

        if (floorManager == null)
        {
            return;
        }

        Handles.Label(floorManager.transform.position + Vector3.up * 5, $"Acive Section: {floorManager.ActiveSection}", Style);

        foreach (FloorSection section in floorManager.ActiveFloorSections.Values)
        {
            Handles.Label(section.transform.position, $"World Index: {section.Index}\r\nPosition: {section.transform.position}", Style);
            Handles.DrawWireCube(section.transform.position - new Vector3(4, -1.5f, -4), new Vector3(10, 2, 10));
        }
    }
Esempio n. 3
0
        public HomeModel GetHomeInfo()
        {
            HomeModel homeModel = new HomeModel();
            //首页Banner
            BannerManager bannerManager = new BannerManager();

            homeModel.Banners = bannerManager.GetHomeBanners();
            //热卖商品列表
            RecommendManager recommandManager = new RecommendManager();

            homeModel.HotSaleProducts = recommandManager.GetHomeHotSaleItemList();

            //新品上市商品列表:
            homeModel.RecommendProducts = recommandManager.GetHomeRecommendProductList();

            //今日特卖商品列表:
            homeModel.TodayHotSaleProducts = recommandManager.GetTodayHotSaleItemlist();

            //首页楼层列表
            FloorManager floorManager = new FloorManager();

            homeModel.Floors = floorManager.GetHomeFloors();

            //精选品牌
            homeModel.Brands = recommandManager.GetRecommendBrands();

            //限时抢购
            QueryResult <CountDownItemModel> countDownList = new CountdownManager().GetCountDownList(0, 3);

            homeModel.CountDownList = countDownList.ResultList;

            return(homeModel);
        }
Esempio n. 4
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (!Closed || FloorManager.IsLevelCleared())
     {
         MyAnim.SetBool("IsOpened", true);
     }
 }
Esempio n. 5
0
        static async Task Main(string[] args)
        {
            Console.WriteLine("started");
            try
            {
                using (var system = ActorSystem.Create("iot-temperature-monitor"))
                {
                    var floorManager = system.ActorOf(FloorManager.Props(), "floor-manager");
                    await CreateSimulatedSensors(floorManager);

                    while (true)
                    {
                        /*Console.WriteLine("Press key to cycle");
                         * var key = Console.ReadLine();
                         * if (key.ToUpperInvariant() == "Q")
                         * {
                         *
                         *  Console.WriteLine("end");
                         *  Environment.Exit(0);
                         * }*/
                        Thread.Sleep(TimeSpan.FromMilliseconds(300));
                        await DisplayTemperatures(system);
                    }
                }
            }
            catch (Exception excp)
            {
                Console.WriteLine("error");
            }
        }
Esempio n. 6
0
    void Start()
    {
        factory      = GetComponent <PersonFactory>();
        floorManager = GetComponent <FloorManager>();
        source       = GetComponent <AudioSource>();
        refFreq      = PitchManager.NoteToPitch(60); // C4

        InputController.OnDoubleTap += OnDoubleTap;
        InputController.OnSingleTap += OnSingleTap;

        Constants.GameOn = false;
        score            = 0;
        timer            = 0;
        gameEnded        = false;
        timerBarPos      = TimerBar.transform.position;
        clients          = new ArrayList();

        if (Constants.Endless)
        {
            spawnTime = Constants.EndlessInitSpawnTime;
            timer     = Constants.EndlessPatience;
        }
        else
        {
            curIdx   = 0;
            levelLen = Constants.Level.Length;
            timer    = Constants.NormalPatience;
        }

        Invoke("StartGame", 1);
    }
Esempio n. 7
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         FloorManager.NextFloor();
     }
 }
Esempio n. 8
0
    private void OnEnable()
    {
        //initialize component
        rb2D     = GetComponent <Rigidbody2D>();
        animator = GetComponent <Animator>();

        //set starting value in order to animate the right position
        ClassDb.charactersCommon.SetStartAnimation(animator);

        cameraMain      = Camera.main;
        isCameraNotNull = cameraMain != null;

        pathUpdated = false;

        speed = 2f;

        floorManager = GameObject.Find(StaticDb.floorTileMap).GetComponent <FloorManager>();

        //check the layout and set the respective parameter for offset and scale
        GetPlayerPathVariables();

        CreateIdInfo();

        SetPlayerSpriteNames();
        spriteToAnimate = nSpriteName;
    }
Esempio n. 9
0
    void Awake()
    {
        greenTransform  = transform.FindChild("TargetGreen");
        yellowTransform = transform.FindChild("TargetYellow");

        floorManagerScript = GameObject.Find("Floor").GetComponent <FloorManager>();
    }
Esempio n. 10
0
    public void Generate(int opt)
    {
        option = opt;
        //option = 0, generate Wall Maze
        //option = 1, generate Tall Maze
        finished = false;
        fm       = GameObject.Find("GameManager").GetComponent <FloorManager>();

        if (option == 0)
        {
            fm.AllWallFloor();
        }
        else if (option == 1)
        {
            fm.AllTallFloor(h);
        }

        floorObjects = fm.floorObjects;

        //starting pos needs to be even
        int startX = Random.Range(0, fm.floor.GetLength(0) / 2) * 2;
        int startY = Random.Range(0, fm.floor.GetLength(1) / 2) * 2;

        past = new List <Coord>();

        CarvePath(startX, startY);
        finished = true;
    }
Esempio n. 11
0
    protected void DropGun(bool Throw)
    {
        //Check for owner
        if (GunInHands == DefaultGun || Locked)
        {
            return;
        }
        GunInHands.Owner = null;

        //Set transform for in hands gun
        GunInHands.transform.parent   = FloorManager.GetCurrentFloorObj().transform;
        GunInHands.transform.position = gameObject.transform.position;
        GunInHands.transform.rotation = Quaternion.identity;

        //Set transform for lies version of gun
        GunInHands.State.Lies.transform.rotation = Quaternion.Euler(0, 0, gameObject.transform.eulerAngles.z - 90);
        GunInHands.State.SetWorldState(WorldState.Lies);

        Rigidbody2D GunBody = GunInHands.State.Lies.GetComponentInChildren <Rigidbody2D>();

        if (Throw)
        {
            //Throw gun if it need
            GunBody.AddRelativeForce(new Vector2(0, ThrowForce), ForceMode2D.Impulse);
        }
        GunBody.AddTorque(ThrowForce * 5);

        GunInHands.DisablePickupTrigger(0.01f);
        PickUpGun(GunToPickUp == null ? DefaultGun : GunToPickUp);
    }
Esempio n. 12
0
 void Start()
 {
     _instance             = this;
     _totalScore           = 0;
     Input.gyro.enabled    = true;
     Input.compass.enabled = true;
     StartCoroutine(WaitAndPrint(1f));
 }
        public void RegisterNewSensor()
        {
            var probe        = CreateTestProbe();
            var floorManager = Sys.ActorOf(FloorManager.Props(), "floor-manager");

            floorManager.Tell(new RequestSensorRegister(54, "a", "2"), probe);
            probe.ExpectMsg <RespondSensorRegistered>();
        }
Esempio n. 14
0
    public void GetOnElevator()
    {
        InElevator = true;
        float xpos = Random.Range(-1f, 1f);
        float ypos = FloorManager.NoteToPos(Origin) + Constants.PersonOffset;

        MoveTowards(new Vector3(xpos, ypos));
    }
Esempio n. 15
0
    public void GetOffElevator()
    {
        InElevator = false;
        float xpos = Random.Range(3f, 5f);
        float ypos = FloorManager.NoteToPos(Destination) + Constants.PersonOffset;

        MoveTowards(new Vector3(xpos, ypos), true);
    }
Esempio n. 16
0
 private void Awake()
 {
     playerStats         = GameObject.Find("objPlayer").GetComponent <EntityStatHandler>();
     playerInventory     = GameObject.Find("objPlayer").GetComponent <InventoryManager>();
     floorManager        = GameObject.Find("Game Manager").GetComponent <FloorManager>();
     playerEntityManager = GameObject.Find("objPlayer").GetComponent <EntityManager>();
     ChangeMenu();
 }
Esempio n. 17
0
    void Awake()
    {
        boxSprite       = transform.FindChild("BoxSprite");
        selectionShadow = transform.FindChild("SelectionShadow");

        boxCountMesh       = transform.FindChild("BoxCounter").GetComponent <TextMesh>();
        floorManagerScript = GameObject.Find("Floor").GetComponent <FloorManager>();
    }
    // Use this for initialization
    void Start()
    {
        floorManager = GameObject.Find("FloorManager").GetComponent <FloorManager>();    // find FloorManager script on FloorManager GameObject

        addSuite.GetComponent <Button>().onClick.AddListener(delegate { SuiteOnClick(); });
        addRestaurant.GetComponent <Button>().onClick.AddListener(delegate { RestaurantOnClick(); });
        addArcade.GetComponent <Button>().onClick.AddListener(delegate { ArcadeOnClick(); });
    }
Esempio n. 19
0
 public FloorManager GetCurrentFloor()
 {
     if (current == null || !current.gameObject.activeInHierarchy)
     {
         current = FindObjectOfType <FloorManager>();
     }
     return(current);
 }
Esempio n. 20
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (ToFloor != FloorManager.GetFloorIndex() || FloorManager.IsLevelStarted())
     {
         BlackScreen.FadeInOut(MyAnim.FrameTime * MyAnim.Sprites.Length);
         PlayerBase.LockControls(true);
         MyAnim.Play();
     }
 }
 private void Awake()
 {
     /** Order of methods calling is critical**/
     if (_Instance == null)
     {
         _Instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Esempio n. 22
0
 private void Awake()
 {
     gm          = GameObject.Find("Game Manager");
     fm          = gm.GetComponent <FloorManager>();
     th          = gm.GetComponent <TurnHandling>();
     amh         = gm.GetComponent <AdventureMenuHandler>();
     eManager    = GetComponent <EntityManager>();
     thisEntity  = transform;
     pathManager = gm.GetComponent <PathRequestManager>();
 }
Esempio n. 23
0
    void Start()
    {
        Camera cam = gameObject.GetComponent <Camera>();

        minHeight = FloorManager.NoteToPos(Constants.MinNote) + cam.orthographicSize - 2;
        maxHeight = FloorManager.NoteToPos(Constants.MaxNote) - cam.orthographicSize + 2;

        target             = FindObjectOfType <ElevatorControl>().transform;
        transform.position = new Vector3(0, minHeight);
    }
Esempio n. 24
0
    void Start () 
    {
        cameraFollow = GameObject.FindObjectOfType<CameraFollow>();
        floor = GameObject.FindObjectOfType<FloorManager>();

        aspect = Mathf.Round(Camera.main.aspect * 100f) / 100f;
        if (aspect >= 1) aspect = 1;

        ShowStartMenu();
	}
Esempio n. 25
0
    public void SetEnemy(InitializeOverWorldEnemy aOverworldEnemy, FloorManager aFloorManager)
    {
        m_FloorManager   = aFloorManager;
        m_OverworldEnemy = aOverworldEnemy;
        m_PositionInPath = 0;
        m_FollowingPath  = true;

        m_Animator = GetComponentInChildren <Animator>();
        SetNodePosition(m_OverworldEnemy.m_SpawnPosition);
    }
Esempio n. 26
0
    void Awake()
    {
        Instance = this;
        DontDestroyOnLoad(this.gameObject);

        currentFloor = 0;

        floors.Add("JustinTestScene 3");
        floors.Add("NewFloor");
    }
Esempio n. 27
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        FloorManager myScript = (FloorManager)target;

        if (GUILayout.Button("Build Grid"))
        {
            myScript.CreateGrid();
        }
    }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (FloorManager.IsLevelStarted() && FloorManager.IsFloorCleared() ||
         !FloorManager.IsLevelStarted())
     {
         BlackScreen.FadeInOut(0.2f, () =>
         {
             FloorManager.SetFloor(ToFloor);
         });
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        floor = GameObject.Find("FloorManager").GetComponent <FloorManager>();

        pitchSlider = gameObject.GetComponent <Slider>();
        //pitchSlider.transform.position = new Vector3(650.0f, 20.0f, 0.0f);
        pitchSlider.minValue     = 1;
        pitchSlider.maxValue     = 5;
        pitchSlider.value        = 3;
        pitchSlider.wholeNumbers = true;
    }
Esempio n. 30
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Esempio n. 31
0
    // Start is called before the first frame update
    void Start()
    {
        _player       = GameObject.Find("player").GetComponent <PlayerControllerInMainScene>();
        _floorManager = GameObject.Find("Floor").GetComponent <FloorManager>();

        StoreArea   = GameObject.Find("StoreArea");
        DungeonArea = GameObject.Find("DungeonArea");

        StoreArea.SetActive(false);
        DungeonArea.SetActive(false);
    }
Esempio n. 32
0
  // Use this for initialization
  void Awake() {

    floorManager = GameObject.FindWithTag("Manager").GetComponent<FloorManager>();

    // Get the size of the spawner array
    maxNumberColours = floorManager.GetColoursLength();
    numberOfFloors = 2;

    // Initialize the spawners
    spawnerListA = new GameObject[maxNumberColours];
    spawnerListB = new GameObject[maxNumberColours];
    for (int i = 0; i < maxNumberColours; i++) {
      spawnerListA[i] = null;
      spawnerListB[i] = null;
    }

    stateManager = GameObject.FindGameObjectWithTag("Manager").GetComponent<StateManager>();

  }
Esempio n. 33
0
 void Start()
 {
     floorManObj = GameObject.Find("Floors").GetComponent<FloorManager>();
 }