Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Failframeit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FrameIT
Failframeit
Commits
c2727815
Commit
c2727815
authored
4 years ago
by
John Schihada
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring
parent
c4c72e06
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Assets/Scripts/InteractionEngine/Fact.cs
+8
-11
8 additions, 11 deletions
Assets/Scripts/InteractionEngine/Fact.cs
Assets/Scripts/InventoryStuff/DisplayFacts.cs
+11
-11
11 additions, 11 deletions
Assets/Scripts/InventoryStuff/DisplayFacts.cs
with
19 additions
and
22 deletions
Assets/Scripts/InteractionEngine/Fact.cs
+
8
−
11
View file @
c2727815
...
...
@@ -46,7 +46,7 @@ public string format(float t)
public
abstract
int
[]
getDependentFactIds
();
public
abstract
GameObject
instantiate
Representation
(
GameObject
prefab
,
Transform
transform
);
public
abstract
GameObject
instantiate
Display
(
GameObject
prefab
,
Transform
transform
);
public
abstract
override
bool
Equals
(
System
.
Object
obj
);
...
...
@@ -163,7 +163,7 @@ public override int[] getDependentFactIds() {
return
null
;
}
public
override
GameObject
instantiate
Representation
(
GameObject
prefab
,
Transform
transform
)
{
public
override
GameObject
instantiate
Display
(
GameObject
prefab
,
Transform
transform
)
{
var
obj
=
GameObject
.
Instantiate
(
prefab
,
Vector3
.
zero
,
Quaternion
.
identity
,
transform
);
obj
.
transform
.
GetChild
(
0
).
gameObject
.
GetComponent
<
TextMeshProUGUI
>().
text
=
""
+
getLetter
(
this
.
Id
);
obj
.
GetComponent
<
FactWrapper
>().
fact
=
this
;
...
...
@@ -208,7 +208,7 @@ public LineFact(int i, int pid1, int pid2)
//Label is currently set to Fact.setId
//Set Label to StringConcatenation of Points
this
.
Label
=
"|"
+
pf1
.
Label
+
pf2
.
Label
+
"|"
;
this
.
Label
=
pf1
.
Label
+
pf2
.
Label
;
string
p1URI
=
pf1
.
backendURI
;
string
p2URI
=
pf2
.
backendURI
;
...
...
@@ -269,7 +269,7 @@ public override int[] getDependentFactIds()
return
new
int
[]
{
Pid1
,
Pid2
};
}
public
override
GameObject
instantiate
Representation
(
GameObject
prefab
,
Transform
transform
)
public
override
GameObject
instantiate
Display
(
GameObject
prefab
,
Transform
transform
)
{
var
obj
=
GameObject
.
Instantiate
(
prefab
,
Vector3
.
zero
,
Quaternion
.
identity
,
transform
);
obj
.
transform
.
GetChild
(
0
).
gameObject
.
GetComponent
<
TextMeshProUGUI
>().
text
=
""
+
getLetter
(
CommunicationEvents
.
Facts
[
this
.
Pid1
].
Id
);
...
...
@@ -316,9 +316,6 @@ public RayFact(int i, int pid1, int pid2)
string
p1URI
=
pf1
.
backendURI
;
string
p2URI
=
pf2
.
backendURI
;
//Set Label to StringConcatenation of Points
this
.
Label
=
pf1
.
Label
+
pf2
.
Label
;
List
<
MMTTerm
>
arguments
=
new
List
<
MMTTerm
>
{
new
OMS
(
p1URI
),
...
...
@@ -380,7 +377,7 @@ public override int[] getDependentFactIds()
return
new
int
[]
{
Pid1
,
Pid2
};
}
public
override
GameObject
instantiate
Representation
(
GameObject
prefab
,
Transform
transform
)
{
public
override
GameObject
instantiate
Display
(
GameObject
prefab
,
Transform
transform
)
{
var
obj
=
GameObject
.
Instantiate
(
prefab
,
Vector3
.
zero
,
Quaternion
.
identity
,
transform
);
obj
.
transform
.
GetChild
(
0
).
gameObject
.
GetComponent
<
TextMeshProUGUI
>().
text
=
""
+
getLetter
(
this
.
Id
);
//obj.transform.GetChild(1).gameObject.GetComponent<TextMeshProUGUI>().text = "" + getLetter(CommunicationEvents.Facts[f.Pid2].Id);
...
...
@@ -425,7 +422,7 @@ public OnLineFact(int i, int pid, int rid)
string
rURI
=
rf
.
backendURI
;
//Set Label to StringConcatenation of Points
this
.
Label
=
pf
.
Label
+
"
∊
"
+
rf
.
Label
;
this
.
Label
=
pf
.
Label
+
"
∈
"
+
rf
.
Label
;
List
<
MMTTerm
>
innerArguments
=
new
List
<
MMTTerm
>
{
...
...
@@ -486,7 +483,7 @@ public override int[] getDependentFactIds()
return
new
int
[]
{
Pid
,
Rid
};
}
public
override
GameObject
instantiate
Representation
(
GameObject
prefab
,
Transform
transform
)
public
override
GameObject
instantiate
Display
(
GameObject
prefab
,
Transform
transform
)
{
var
obj
=
GameObject
.
Instantiate
(
prefab
,
Vector3
.
zero
,
Quaternion
.
identity
,
transform
);
obj
.
transform
.
GetChild
(
0
).
gameObject
.
GetComponent
<
TextMeshProUGUI
>().
text
=
""
+
getLetter
(
CommunicationEvents
.
Facts
[
this
.
Pid
].
Id
);
...
...
@@ -678,7 +675,7 @@ public override int[] getDependentFactIds()
return
new
int
[]
{
Pid1
,
Pid2
,
Pid3
};
}
public
override
GameObject
instantiate
Representation
(
GameObject
prefab
,
Transform
transform
)
{
public
override
GameObject
instantiate
Display
(
GameObject
prefab
,
Transform
transform
)
{
var
obj
=
GameObject
.
Instantiate
(
prefab
,
Vector3
.
zero
,
Quaternion
.
identity
,
transform
);
obj
.
transform
.
GetChild
(
0
).
gameObject
.
GetComponent
<
TextMeshProUGUI
>().
text
=
""
+
getLetter
(
CommunicationEvents
.
Facts
[
this
.
Pid1
].
Id
);
obj
.
transform
.
GetChild
(
1
).
gameObject
.
GetComponent
<
TextMeshProUGUI
>().
text
=
""
+
getLetter
(
CommunicationEvents
.
Facts
[
this
.
Pid2
].
Id
);
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/InventoryStuff/DisplayFacts.cs
+
11
−
11
View file @
c2727815
...
...
@@ -6,6 +6,8 @@
public
class
DisplayFacts
:
MonoBehaviour
{
public
Dictionary
<
Type
,
GameObject
>
prefabDictionary
;
public
Dictionary
<
string
,
GameObject
>
displayedFacts
=
new
Dictionary
<
string
,
GameObject
>();
public
GameObject
prefab_Point
;
...
...
@@ -15,8 +17,6 @@ public class DisplayFacts : MonoBehaviour
public
GameObject
prefab_OnLine
;
public
GameObject
prefab_Line
;
public
Dictionary
<
string
,
GameObject
>
prefabDictionary
;
public
int
x_Start
;
public
int
y_Start
;
public
int
X_Pacece_Between_Items
;
...
...
@@ -26,6 +26,14 @@ public class DisplayFacts : MonoBehaviour
//Start is called before the first frame update
void
Start
()
{
prefabDictionary
=
new
Dictionary
<
Type
,
GameObject
>()
{
{
typeof
(
PointFact
),
prefab_Point
},
{
typeof
(
LineFact
),
prefab_Distance
},
{
typeof
(
RayFact
),
prefab_Line
},
{
typeof
(
AngleFact
),
prefab_Angle
},
{
typeof
(
OnLineFact
),
prefab_OnLine
}
};
var
rect
=
GetComponent
<
RectTransform
>();
x_Start
=
(
int
)(
rect
.
rect
.
x
+
X_Pacece_Between_Items
*
.
5f
);
y_Start
=
(
int
)(-
rect
.
rect
.
y
-
y_Pacece_Between_Items
*
.
5f
);
//);
...
...
@@ -33,14 +41,6 @@ void Start()
AddFactEvent
.
AddListener
(
AddFact
);
AnimateExistingFactEvent
.
AddListener
(
AnimateFact
);
prefabDictionary
=
new
Dictionary
<
string
,
GameObject
>()
{
{
"PointFact"
,
prefab_Point
},
{
"LineFact"
,
prefab_Distance
},
{
"RayFact"
,
prefab_Line
},
{
"AngleFact"
,
prefab_Angle
},
{
"OnLineFact"
,
prefab_OnLine
}
};
}
public
void
AddFact
(
Fact
fact
)
{
...
...
@@ -61,7 +61,7 @@ string getLetter(int Id) {
private
GameObject
CreateDisplay
(
Transform
transform
,
Fact
fact
)
{
return
fact
.
instantiate
Representation
(
prefabDictionary
[
fact
.
GetType
()
.
Name
],
transform
);
return
fact
.
instantiate
Display
(
prefabDictionary
[
fact
.
GetType
()],
transform
);
}
public
Vector3
GetPosition
(
int
i
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment