Inheritance: MonoBehaviour
Exemplo n.º 1
0
        private Border CreateContentBorder(int i, DayNight dayNight, Service service)
        {
            var border1 = new Border();

            border1.BorderBrush     = Brushes.Gray;
            border1.BorderThickness = new Thickness(0, 0.5, 1, 0.5);
            var planning = service.PlanningUnits?.FirstOrDefault(p => p.Date == StartDate.AddDays(i) && p.DayNight == dayNight);


            var listEditorControl = new ListEditorControl {
                ResourceItems = ResourceItems, DayNight = dayNight, Date = StartDate.AddDays(i), ObservableResources = planning?.Employees.Select(e => new Resource(e)).ToObservableCollection() ?? new ObservableCollection <Resource>()
            };


            Binding myBinding = new Binding();

            myBinding.Source = this;
            myBinding.Path   = new PropertyPath("IsEdited");
            myBinding.Mode   = BindingMode.TwoWay;
            myBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            BindingOperations.SetBinding(listEditorControl, ListEditorControl.IsEditedProperty, myBinding);

            border1.Child = listEditorControl;
            Grid.SetColumn(border1, i);
            return(border1);
        }
Exemplo n.º 2
0
 public Onah(int day, int month, int year, DayNight dayNight)
     : this(dayNight)
 {
     this.Day   = day;
     this.Month = new MonthObject(year, month);
     this.Year  = year;
 }
Exemplo n.º 3
0
    public override void _Ready()
    {
        // Fetch all the nodes
        Controller = new PlayerController(this);
        Sprite     = (AnimatedSprite)GetNode("Sprite");

        RayPivot = (Area2D)GetNode("RayPivot");

        UI = (Control)GetNode("UI/ControlUI");

        Clock       = (RichTextLabel)GetNode("UI/ControlUI/Clock");
        DialogueBox = (Dialogue)GetNode("DialogueBox");

        CurrencyLabel = (RichTextLabel)GetNode("UI/ControlUI/Currency");
        Currency     += 5;

        Inventory = new Inventory(5); // Instantiate the inventory

        // Handles the time node
        if (Owner.HasNode("DayNight"))
        {
            TimeNode = (DayNight)Owner.GetNode("DayNight");
        }
        else
        {
            GD.Print("WARNING: No DayNight Node, day-night system won't be implemented in scene (Crops won't grow, daylight amount won't change, etc).");
        }
    }
Exemplo n.º 4
0
 void Awake()
 {
     night = 0;
     dayNight = FindObjectOfType<DayNight>();
     enemySpawner = GetComponent<EnemySpawner>();
     itemSpawner = GetComponent<ItemSpawner>();
     audioManager = GetComponent<AudioManager>();
 }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if (ilosc <= 0)
        {
            Zniszcz();
        }

        DayNight.Shadow(transform, FindObjectOfType <DayNight>());
    }
Exemplo n.º 6
0
    void Start()
    {
        DayNightScript = GetComponent<DayNight>();
        DayNightScript.stars.SetActive(false);

        transform.eulerAngles = new Vector3(20, 0, 0);
        
        mainLight = GetComponent<Light>();
        skyMat = RenderSettings.skybox;
    }
Exemplo n.º 7
0
        public SimpleResponse TimeSet(Player commander, DayNight time)
        {
            Level level = commander.Level;

            level.CurrentWorldTime = (int)time;

            return(new SimpleResponse {
                Body = $"{commander.Username} sets time to {time}"
            });
        }
Exemplo n.º 8
0
 public void ChangeDayNight(DayNight dayNight)
 {
     if (dayNight == DayNight.Day)
     {
         DayNightText.text = "Night";
     }
     else
     {
         DayNightText.text = "Day";
     }
 }
Exemplo n.º 9
0
 void Awake()
 {
     if (i == null)
     {
         i = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (i != null)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        hit      = false;
        hitTime  = Time.realtimeSinceStartup;
        target   = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform> ();
        targetHP = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl> ().health;
        gameObject.transform.Rotate(-90, 0, 0);

        sun = GameObject.FindGameObjectWithTag("Sun").GetComponent <DayNight> ();

        p = GameObject.FindGameObjectWithTag("Sun").GetComponent <DayNight> ().paused;
    }
Exemplo n.º 11
0
    // Start is called before the first frame update
    void Start()
    {
        //save reference to time cycle
        timeCycle = GetComponent <DayNight>();

        //subscribe certain methods to fish event at the start of the game
        fishEvent += radio.GetComponent <Radio>().PlaySequenceClip;
        fishEvent += FishingRod.instance.SetEventFish;

        //make sure event index is at 0
        eventIndex = 0;
    }
Exemplo n.º 12
0
 private void Awake()
 {
     dayNight = GameObject.FindWithTag("Time").GetComponent <DayNight>();
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 13
0
        public string TimeSet(Player commander, DayNight time)
        {
            Level level = commander.Level;

            level.WorldTime = (int)time;

            McpeSetTime message = McpeSetTime.CreateObject();

            message.time = (int)level.WorldTime;
            level.RelayBroadcast(message);

            return($"{commander.Username} sets time to {time}");
        }
Exemplo n.º 14
0
    public override void _Ready()
    {
        Controller = new PlayerController(this);
        Sprite     = (AnimatedSprite)GetNode("Sprite");

        RayPivot = (Node2D)GetNode("RayPivot");
        Clock    = (RichTextLabel)GetNode("UI/ControlUI/Clock");

        Inventory = new Inventory();
        Inventory.Items.Add(Tools.GetTool(0));
        Inventory.Items.Add(Tools.GetTool(1));

        TimeNode = (DayNight)GetNode("DayNight");
    }
Exemplo n.º 15
0
        public SimpleResponse TimeSet(Player commander, DayNight time)
        {
            Level level = commander.Level;

            level.CurrentWorldTime = (int)time;

            McpeSetTime message = McpeSetTime.CreateObject();

            message.time    = (int)level.CurrentWorldTime;
            message.started = level.IsWorldTimeStarted;

            level.RelayBroadcast(message);

            return(new SimpleResponse {
                Body = $"{commander.Username} sets time to {time}"
            });
        }
Exemplo n.º 16
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (DayNight != 0)
            {
                hash ^= DayNight.GetHashCode();
            }
            if (MoonPhase != 0)
            {
                hash ^= MoonPhase.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 17
0
    public override void _Ready()
    {
        Controller = new PlayerController(this);
        Sprite     = (AnimatedSprite)GetNode("Sprite");

        RayPivot = (Node2D)GetNode("RayPivot");

        Clock                   = (RichTextLabel)GetNode("UI/ControlUI/Clock");
        MessageLabel            = (RichTextLabel)GetNode("UI/ControlUI/Message");
        MessageLabel.BbcodeText = "";

        CurrencyLabel = (RichTextLabel)GetNode("UI/ControlUI/Currency");
        Currency     += 5;

        Inventory = new Inventory();
        Inventory.Items.Add(Database <Item> .Get("Tools\\BasicHoe"));
        Inventory.Items.Add(Database <Item> .Get("Tools\\BasicWateringCan"));

        TimeNode = (DayNight)GetNode("DayNight");
    }
Exemplo n.º 18
0
        // 初始化王國
        void InitializeKingdom()
        {
            int month = Mathf.CeilToInt(round * 0.5f);

            daynight = (DayNight)(round % 2);
            source.PlayOneShot(clips[(int)daynight]);
            background.sprite        = spriteBG[(int)daynight];
            textDate.text            = "163年 " + month + "月 " + daynight.ToString();
            textSolaPlayerCount.text = "0";
            textLunaPlayerCount.text = "0";
            textSolaCastleCount.text = "0";
            textLunaCastleCount.text = "0";
            textStep.text            = "挑戰者決定";
            textKingdomNews.text     = "請主持人確認本場遊戲挑戰者";
            for (int i = 0; i < 12; i++)
            {
                textAllPlayerName[i].transform.parent.gameObject.SetActive(false);
            }
            panelPlayerCount.SetActive(true);
        }
Exemplo n.º 19
0
 private void Awake()
 {
     dayNight = GameObject.FindWithTag("Time").GetComponent <DayNight>();
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
     //playerController = GameObject.Find("MovePoint");
     canvasGroup = GameObject.Find("BlackoutImage").GetComponent <CanvasGroup>();
     duskText    = GameObject.Find("DuskText").GetComponent <Text>();
     sleepText   = GameObject.Find("NightText").GetComponent <Text>();
     //InvokeRepeating("TrackTime", 1f, 1f);
     if (!charlotteInitialized)
     {
         charlotte = GameObject.Find("Charlotte");
         charlotte.SetActive(false);
         charlotteInitialized = true;
     }
 }
Exemplo n.º 20
0
 private void Awake()
 {
     Instance = this;
 }
Exemplo n.º 21
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject go_GameManager = GameObject.FindGameObjectWithTag("GameManager");

        time = go_GameManager.GetComponent <DayNight>();
    }
Exemplo n.º 22
0
    public void LoadGameObjects()
    {
        Debug.Log("Loading Game Objects Into Game Manager");


        if (this.Mendelbulb == null)
        {
            this.Mendelbulb = GameObject.Find("Mandelbulb");
        }
        if (this.Sun == null)
        {
            this.Sun = GameObject.Find("Sun");
        }
        if (this.Moon == null)
        {
            this.Moon = GameObject.Find("Moon");
        }

        if (this.StarSprites == null)
        {
            this.StarSprites = GameObject.Find("Stars");
        }

        if (this.InteractableOrbs == null)
        {
            this.InteractableOrbs = GameObject.Find("InteractableOrbs");
        }
        if (this.interactableManager == null && this.InteractableOrbs != null)
        {
            this.interactableManager = this.InteractableOrbs.GetComponent <InteractableManager>();
        }

        if (this.RFloor == null)
        {
            this.RFloor = GameObject.Find("Floor- Reflective");
        }
        if (this.Rings == null)
        {
            this.Rings = GameObject.Find("Rings");
        }
        if (this.ringManagerScript == null)
        {
            this.ringManagerScript = this.Rings.GetComponent <RingManager>();
        }
        if (this.PlanetOrbit == null)
        {
            this.PlanetOrbit = GameObject.Find("PlanetOrbit");
        }
        if (this.mandelBulbOrbitScript == null)
        {
            this.mandelBulbOrbitScript = this.PlanetOrbit.GetComponent <Orbit>();
        }


        if (this.dayNightScript == null)
        {
            this.dayNightScript = this.GetComponent <DayNight>();
        }



        if (this.mandelBulbScript == null && Mendelbulb != null)
        {
            this.mandelBulbScript = Mendelbulb.GetComponent <FractalManager>();
        }
        if (this.mandelBulbRig == null && Mendelbulb != null)
        {
            this.mandelBulbRig = Mendelbulb.GetComponent <Rigidbody>();
        }

        if (this.skyboxManager == null)
        {
            this.skyboxManager = this.GetComponent <SkyboxManager>();
        }
    }
Exemplo n.º 23
0
 void Start()
 {
     DayNight = GameObject.Find("Celestial").GetComponent <DayNight>();
 }
Exemplo n.º 24
0
 public InputTossCondition(PlanetEnum planet, Weather weather, DayNight dayNight)
 {
     Planet   = planet;
     Weather  = weather;
     DayNight = dayNight;
 }
Exemplo n.º 25
0
        public static decimal TestCalculateFee(DateTime startTime, DateTime endTime, string feeRuleId)
        {
            IParkFeeRule factory = ParkFeeRuleFactory.GetFactory();
            ParkFeeRule  rule    = factory.QueryParkFeeRuleByFeeRuleId(feeRuleId);

            if (rule == null)
            {
                throw new MyException("获取规则失败");
            }

            switch (rule.FeeType)
            {
            case FeeType.DayAndNight: {
                IFeeRule IFee = new DayNight();
                IFee.ParkingBeginTime = startTime;
                IFee.ParkingEndTime   = endTime;
                IFee.FeeRule          = rule;
                IFee.listRuleDetail   = rule.ParkFeeRuleDetails;
                return(IFee.CalcFee());
            }

            case FeeType.Hour12:
            {
                IFeeRule IFee = new Hours12();
                IFee.ParkingBeginTime = startTime;
                IFee.ParkingEndTime   = endTime;
                IFee.FeeRule          = rule;
                IFee.listRuleDetail   = rule.ParkFeeRuleDetails;
                return(IFee.CalcFee());
            }

            case FeeType.Hour24:
            {
                IFeeRule IFee = new Hours24();
                IFee.ParkingBeginTime = startTime;
                IFee.ParkingEndTime   = endTime;
                IFee.FeeRule          = rule;
                IFee.listRuleDetail   = rule.ParkFeeRuleDetails;
                return(IFee.CalcFee());
            }

            case FeeType.NaturalDay:
            {
                IFeeRule IFee = new NaturalDay();
                IFee.ParkingBeginTime = startTime;
                IFee.ParkingEndTime   = endTime;
                IFee.FeeRule          = rule;
                IFee.listRuleDetail   = rule.ParkFeeRuleDetails;
                return(IFee.CalcFee());
            }

            case FeeType.Custom:
            {
                IFeeRule IFee = new Userdefined2();
                IFee.ParkingBeginTime = startTime;
                IFee.ParkingEndTime   = endTime;
                IFee.FeeRule          = rule;
                IFee.FeeText          = rule.RuleText;
                return(IFee.CalcFee());
            }

            default: throw new MyException("算费规则不存在");
            }
        }
Exemplo n.º 26
0
 public Onah(DateTime dateTime, DayNight dayNight)
     : this(dateTime)
 {
     this.DayNight = dayNight;
 }
Exemplo n.º 27
0
 public Kavuah(DayNight dayNight) : this()
 {
     this.DayNight = dayNight;
 }
Exemplo n.º 28
0
 public Onah(DayNight dayNight)
     : this()
 {
     this.DayNight = dayNight;
 }
Exemplo n.º 29
0
 public Kavuah(KavuahType kavuahType, DayNight dayNight) : this(dayNight)
 {
     this.KavuahType = kavuahType;
 }
Exemplo n.º 30
0
 public void FindDayNight()
 {
     dayNight       = GameObject.Find("DayNight").GetComponent <DayNight>();
     dayObjectFount = true;
 }
Exemplo n.º 31
0
    public void MakeGameManager()
    {
        Debug.Log("Loading Game Objects Into Game Manager");

        // Loading Null components
        if (this.Room == null)
        {
            this.Room = GameObject.Find("Box");
        }
        if (this.RoomLid == null)
        {
            this.RoomLid = GameObject.Find("Lid");
        }
        if (this.Mendelbulb == null)
        {
            this.Mendelbulb = GameObject.Find("Mandelbulb");
        }
        if (this.Sun == null)
        {
            this.Sun = GameObject.Find("Sun");
        }
        if (this.Moon == null)
        {
            this.Moon = GameObject.Find("Moon");
        }
        if (this.BlueLight == null)
        {
            GameObject tmpObj = GameObject.Find("Blue Light");
            if (tmpObj != null)
            {
                this.BlueLight = tmpObj.GetComponent <Material>();
            }
            else
            {
                Debug.Log("Could not find Blue Light");
            }
        }
        if (this.YellowLight == null)
        {
            GameObject tmpObj = GameObject.Find("Yellow Light");
            if (tmpObj != null)
            {
                this.YellowLight = tmpObj.GetComponent <Material>();
            }
            else
            {
                Debug.Log("Could not find Yellow Light");
            }
        }
        if (this.PinkLight == null)
        {
            GameObject tmpObj = GameObject.Find("Pink Light");
            if (tmpObj != null)
            {
                this.PinkLight = tmpObj.GetComponent <Material>();
            }
            else
            {
                Debug.Log("Could not find Pink Light");
            }
        }
        if (this.StarSprites == null)
        {
            this.StarSprites = GameObject.Find("Stars");
        }
        if (this.Sofa == null)
        {
            GameObject tmpObj = GameObject.Find("Sofa");
            if (tmpObj != null)
            {
                this.Sofa = tmpObj.GetComponent <Material>();
            }
            else
            {
                Debug.Log("Could not find Sofa");
            }
        }
        if (this.VRCanvas == null)
        {
            this.VRCanvas = GameObject.Find("VRCanvas");
        }
        if (this.PointLight == null)
        {
            this.PointLight = GameObject.Find("Point Light");
        }
        if (this.InteractableOrbs == null)
        {
            this.InteractableOrbs = GameObject.Find("InteractableOrbs");
        }
        if (this.SkipSceneCanvas == null)
        {
            this.SkipSceneCanvas = GameObject.Find("SkipSceneCanvas");
        }
        if (this.RFloor == null)
        {
            this.RFloor = GameObject.Find("Floor- Reflective");
        }
        if (this.TutorialCanvas == null)
        {
            this.TutorialCanvas = GameObject.Find("TutorialCanvas");
        }

        if (this.dayNightScript == null)
        {
            this.dayNightScript = this.GetComponent <DayNight>();
        }
        if (this.pointLightLight == null)
        {
            this.pointLightLight = PointLight.GetComponent <Light>();
        }

        if (this.tutorialCanvasGroup == null)
        {
            this.tutorialCanvasGroup = this.TutorialCanvas.GetComponent <CanvasGroup>();
        }
        if (this.mandelBulbScript == null)
        {
            this.mandelBulbScript = Mendelbulb.GetComponent <FractalManager>();
        }

        if (this.RoomMaterial == null)
        {
            this.RoomMaterial = this.Room.GetComponent <Material>();
        }
        if (this.RoomLidMaterial == null)
        {
            this.RoomLidMaterial = this.RoomLid.GetComponent <Material>();
        }
    }
Exemplo n.º 32
0
 public static void Shadow(Transform trans, DayNight dn)
 {
     trans.Find("Shadow").eulerAngles = new Vector3(trans.Find("Shadow").eulerAngles.x, trans.Find("Shadow").eulerAngles.y, -dn.time * (360 / 12) + 180);
 }