public void DeleteTileContents() { building = null; mobility = Moveability.Passable; isHouse = false; clear = true; }
public void MakeOther(GameObject building, int size, IntPoint2D topLeft) { mobility = Moveability.Impassable; clear = false; this.building = building; buildingSize = size; this.buildingTopLeft = topLeft; }
public void MakeRoad(GameObject tile, IntPoint2D topLeft) { mobility = Moveability.Road; clear = false; building = tile; buildingSize = 1; this.buildingTopLeft = topLeft; }
public GridTileInfo() { mobility = Moveability.Passable; clear = true; building = null; isHouse = false; buildingSize = 0; }
public void MakeHouse(GameObject house, IntPoint2D topLeft) { mobility = Moveability.Impassable; clear = false; building = house; isHouse = true; buildingSize = 1; this.buildingTopLeft = topLeft; }
public override void OnInspectorGUI() { base.OnInspectorGUI(); Moveability moveability = (Moveability)target; if (GUILayout.Button("Add Keyframe")) { GameObject keyframe = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Prefabs/Technical/Keyframe.prefab"); GameObject key = Instantiate(keyframe, moveability.transform.position, moveability.transform.rotation); moveability.keyframes.Add(key.transform); } GUILayout.BeginHorizontal(); if (GUILayout.RepeatButton("Test")) { moveability.Move(); } if (GUILayout.RepeatButton("Reset")) { moveability.transform.position = moveability.keyframes[0].position; moveability.transform.rotation = moveability.keyframes[0].rotation; moveability.currentKeyframe = 0; } GUILayout.EndHorizontal(); GUILayout.Label("Warning - This removes all assigned Keyframes", EditorStyles.boldLabel); if (GUILayout.Button("Remove Moving Property")) { foreach (Transform t in moveability.keyframes) { DestroyImmediate(t.gameObject); } DestroyImmediate(moveability.GetComponent <Rigidbody2D>()); DestroyImmediate(moveability); } }