public override void OnEnter() { base.OnEnter(); var _db = databoxObject.Value as DataboxObject; if (useOwnerInstanceID) { entryID = Owner.gameObject.GetInstanceID().ToString(); } DataboxType _data = null; switch (dataType) { case DataType.Float: _data = new FloatType(); break; case DataType.Int: _data = new IntType(); break; case DataType.Bool: _data = new BoolType(); break; case DataType.String: _data = new StringType(); break; case DataType.Color: _data = new ColorType(); break; case DataType.Quaternion: _data = new QuaternionType(); break; case DataType.Vector2: _data = new Vector2Type(); break; case DataType.Vector3: _data = new Vector3Type(); break; } _db.AddData(tableID, entryID, valueID, _data); Finish(); }
private void SetInputFake() // redirect public methods and properties to our replay system { GetKey = FakeGetKey; GetKeyDown = FakeGetKeyDown; GetKeyUp = FakeGetKeyUp; GetMouseButton = FakeGetMouseButton; GetMouseButtonDown = FakeGetMouseButtonDown; GetMouseButtonUp = FakeGetMouseButtonUp; GetButton = delegate(string name) { return(currentSequence.vB.Contains(name)); }; GetButtonDown = delegate(string name) { return(currentSequence.vBD.Contains(name)); }; GetButtonUp = delegate(string name) { return(currentSequence.vBU.Contains(name)); }; GetAxis = delegate(string name) { return(currentSequence.vA.ElementAt(AxisList.FindIndex(str => str == name))); }; _mousePosition = delegate { return(currentSequence.mP); }; _mouseWorldPosition = delegate { return(currentSequence.mWP); }; _mouseScrollDelta = delegate { return(currentSequence.mSD); }; _anyKey = delegate { return(currentSequence.gK.Any <KeyCode>()); }; _anyKeyDown = delegate { return(currentSequence.gKD.Any <KeyCode>()); }; }
private void SetInputStd() // redirect public methods and properties to actual UnityEngine.Input { GetKey = Input.GetKey; GetKeyDown = Input.GetKeyDown; GetKeyUp = Input.GetKeyUp; GetMouseButton = Input.GetMouseButton; GetMouseButtonDown = Input.GetMouseButtonDown; GetMouseButtonUp = Input.GetMouseButtonUp; GetButton = Input.GetButton; GetButtonDown = Input.GetButtonDown; GetButtonUp = Input.GetButtonUp; GetAxis = Input.GetAxis; _mousePosition = delegate { return(Input.mousePosition); }; _mouseWorldPosition = delegate { return(Camera.main.ScreenToWorldPoint(Input.mousePosition)); }; _mouseScrollDelta = delegate { return(Input.mouseScrollDelta); }; _anyKey = delegate { return(Input.anyKey); }; _anyKeyDown = delegate { return(Input.anyKeyDown); }; }
static SupportTypeUtil() { IType type = new IntType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new FloatType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new StringType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new ListIntType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new ListStringType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new ListFloatType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new Vector2Type(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new Vector3Type(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new DesType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new DictionaryIntIntType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new DictionaryIntStringType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); type = new ListListStringType(); _supportTypeMap.Add(type.lowerName, type); _suportTypeList.Add(type.realName); }