public static EventSys GetInstance() { if (instance == null) { instance = new EventSys(); } return(instance); }
public void BackTo2D() { VRCanvas.SetActive(false); NonVRCanvas.SetActive(true); StartCoroutine(SwitchTo2D()); Pointer.SetActive(false); EventSys.SetActive(true); GvrSys.SetActive(false); }
public void StartSwitchToVR() { StartCoroutine(SwitchToVR()); VRCanvas.SetActive(true); NonVRCanvas.SetActive(false); Pointer.SetActive(true); EventSys.SetActive(false); GvrSys.SetActive(true); }
public override void ReciveInput(int x, int y, ClickType type) { if (type == ClickType.Down) { printer.SetMaskArea(); printer.FloodFillMaskThread(x, y, Color.blue, printer.GetColor(x, y)); EventSys.GetInstance().MagicBandEnd(); } }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player"); tp = GameObject.FindGameObjectWithTag("TP").transform; nav = GetComponent <NavMeshAgent>(); anim = GetComponent <Animator>(); rigid = GetComponent <Rigidbody>(); stats = GetComponent <EnemyStats>(); code = GameManager.instance; sys = EventSys.instance; }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject);//only one exist } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
void Awake() { texture = new Texture2D(1, 1); colorArray = new Color[1]; paletteTexture = new Texture2D(255, 255); paletteColorArray = new Color[255 * 255]; image.texture = texture; MakeSliderTexture(); MakeBackGrounp(); SliderChange(); Init(); EventSys.GetInstance().changeToningColor += ToningUI_changeToningColor; }
public override void Init() { if (_isInited) { return; } _allHander = new List <EventSysCallBack>(); _mapDealer = new CDealerMap <int, CDealerCB>(); _eventQueue = new Queue(); _recordStackList = new List <int>(); _isInited = true; Instance = this; //SetRecordStack(int.ChangeGameState, true); //RecordAll(true); }
public override void ReciveInput(int x, int y, ClickType type) { if (isDraw) { if (type == ClickType.Down) { drawRectangle.Draw(); } } // if(ty) if (type == ClickType.Up) { if (isDrag) { isDrag = false; drawRectangle.SetNotDrag(); } if (isDraw) { EventSys.GetInstance().ChooseAreaEnd(); drawRectangle.LockArea(); isDraw = false; drawRectangle.GetArea(); } } if (type == ClickType.Down) { if (!isDraw) { if (drawRectangle.IsInArea()) { isDrag = true; drawRectangle.SetDrag(); } } } if (isDrag) { drawRectangle.Drag(); } }
// Update is called once per frame void Update() { if (sys == null) { sys = FindObjectOfType <EventSys>(); } CheckDistance(); if (distance <= 5 && onlyOnce == true) { sys.SetAction(action); onlyOnce = false; portalTxt.gameObject.SetActive(true); } if (distance > 5 && onlyOnce == false) { sys.SetAction(0); onlyOnce = true; portalTxt.gameObject.SetActive(false); } }
// Update is called once per frame void Update() { if (sys == null) { sys = EventSys.instance; } CheckDistance(); if (distance <= 10 && onlyOnce == true) { sys.SetAction(action); onlyOnce = false; portalTxt.gameObject.SetActive(true); } if (distance > 10 && onlyOnce == false) { sys.SetAction(0); onlyOnce = true; portalTxt.gameObject.SetActive(false); } }
void Awake() { Init(); brushTypeDropDown = GetChild <Dropdown>("BrushTypeDropdown"); brushSizeSlider = GetChild <Slider>("BrushSizeSlider"); concentrationSlider = GetChild <Slider>("BrushConcentrationSlider"); magicBandToggle = GetChild <Toggle>("magicBandToggle"); getColorToggle = GetChild <Toggle>("getColorToggle"); paintPailToggle = GetChild <Toggle>("paintPailToggle"); bezierToggle = GetChild <Toggle>("bezierToggle"); cancelMagicBandButton = GetChild <Button>("CancelMagicBandButton"); mosaicToggle = GetChild <Toggle>("MosaicToggle"); mosaicAreaSlider = GetChild <Slider>("MosaicAreaSlider"); mosaicValSlider = GetChild <Slider>("MosaicValSlider"); chooseAreaToggle = GetChild <Toggle>("ChooseAreaToggle"); cancelChooseAreaButton = GetChild <Button>("CancelChooseAreaButton"); List <Dropdown.OptionData> list = new List <Dropdown.OptionData>(); list.Add(new Dropdown.OptionData("铅笔")); list.Add(new Dropdown.OptionData("笔")); list.Add(new Dropdown.OptionData("橡皮擦")); brushTypeDropDown.options = list; magicBandToggle.onValueChanged.AddListener(MagicBandToggleChange); getColorToggle.onValueChanged.AddListener(GetColorToggleChange); paintPailToggle.onValueChanged.AddListener(PaintPailToggleChange); bezierToggle.onValueChanged.AddListener(BezierToggleChange); cancelMagicBandButton.onClick.AddListener(CancelMagicBandButtonClick); mosaicToggle.onValueChanged.AddListener(MosaicToggleChange); mosaicAreaSlider.onValueChanged.AddListener(MosaicSliderValValueChange); mosaicValSlider.onValueChanged.AddListener(MosaicSliderValValueChange); chooseAreaToggle.onValueChanged.AddListener(ChooseToggleValueChange); cancelChooseAreaButton.onClick.AddListener(ChooseAreaButtonClick); EventSys.GetInstance().magicBandEnd += BrushMenuUI_magicBandEnd; EventSys.GetInstance().chooseAreaEnd += BrushMenuUI_chooseAreaEnd; }
void Start() { player = GameObject.FindGameObjectWithTag("Player"); sys = EventSys.instance; }
public override void ReciveInput(int x, int y, ClickType type) { Color32 c = printer.GetColor(x, y); EventSys.GetInstance().ChangeToningColor(c); }
//----------------------------------------------------------------// ///////////////////////////MainFunctions//////////////////////////// public override void Init() { Instance = this; }
// Start is called before the first frame update void Start() { sys = EventSys.instance; }