void OnGUI() { if(showInfo) { GUI.TextArea(new Rect(100,100,300,200),infoText); if(GUI.Button(new Rect(100,320,50,30),"OK")) showInfo = false; } if(!fillPlayerInfo) { name = GUI.TextField(new Rect(100,100,100,25),name); food = GUI.TextField(new Rect(100,130,100,25),food); if(GUI.Button(new Rect(100,160,100,25),"OK")) { StartTrack(); TextInfoAction tAction = new TextInfoAction(); tAction.Record(string.Format("name:{0},food:{1}",name,food)); ActionTracker.TrackAction(tAction); fillPlayerInfo = true; } } }
protected virtual void trackModeInit() { //record player data TextInfoAction tAction = new TextInfoAction(); tAction.Record(PlayerInfo); ActionTracker.TrackAction(tAction); }
private void startPointingTarget(DynamicObject target) { TextInfoAction tAction = new TextInfoAction(); tAction.Record(string.Format("[StartPoint]PlayerPos:{0},TargetName:{1},TargetPos:{2}", PlayerObject.Instance.Position, target.name, target.transform.position)); ActionTracker.TrackAction(tAction); }
private void recordTopDown(Vector3 targetPos) { Ray r = OrthCamera.ScreenPointToRay(new Vector3(crosshairPos.x * Screen.width, (1.0f - crosshairPos.y) * Screen.height,0)); tempRAyDisplay = r; RaycastHit hit; TextInfoAction tAction = new TextInfoAction(); if(TopDownRaycastTerrain.Raycast (r, out hit, 10000)) { tAction.Record(string.Format("[TopDown]Player:{0},Target:{1}", new Vector2(hit.point.x,hit.point.z), new Vector2(targetPos.x,targetPos.z))); } else { tAction.Record("[TopDown]Out Of Terrain!"); } ActionTracker.TrackAction(tAction); }
private void endPointingTarget() { TextInfoAction tAction = new TextInfoAction(); tAction.Record(string.Format("[EndPoint]PointAngle:{0},PointDir:{1}", PlayerObject.Instance.DirectionAngle, PlayerObject.Instance.Direction)); ActionTracker.TrackAction(tAction); }
private void addFindObjTask(DynamicObject targetObj, int count, string text, bool teleport, Vector3 telePos, Vector3 teleDir) { Task task = new Task (); task.TaskText = text; task.OnTaskStart += (Task self) => { ShowTaskInfo(self.TaskText); if(teleport) PlayerObject.Instance.TeleportTo(telePos, teleDir); return false; }; task.OnTaskProgressCheck += (Task self) => { return checkInteractedObject(targetObj.name); }; task.OnTaskEnd += (Task self) => { TextInfoAction tAction = new TextInfoAction(); tAction.Record(string.Format("[Interactive]TargetName:{0},Count:{1}", targetObj.name, count)); ActionTracker.TrackAction(tAction); return false; }; taskMgr.PushTask(task); }
/// <summary> /// Create an action from a string line /// </summary> public static Action Create(string line) { Action.ActionTypes actionType = (Action.ActionTypes)int.Parse(line.Substring (0, line.IndexOf (','))); switch(actionType) { case Action.ActionTypes.Movement: MovementAction mAction = new MovementAction(); mAction.Load(line); return mAction; break; case Action.ActionTypes.Look: LookAction lAction = new LookAction(); lAction.Load(line); return lAction; break; case Action.ActionTypes.Interact: InteractAction iAction = new InteractAction(); iAction.Load(line); return iAction; break; case Action.ActionTypes.TextInfo: TextInfoAction tAction = new TextInfoAction(); tAction.Load(line); return tAction; break; case Action.ActionTypes.Teleport: TeleportAction tlAction = new TeleportAction(); tlAction.Load(line); return tlAction; break; default: return null; break; } }