public Shape(Core.ShapeNS.Shape shape) { var shapeTransform = shape.transform; firstPosition = shapeTransform.position; firstEulerAngles = shapeTransform.eulerAngles; shapeType = shape.ShapeType; firstScale = shapeTransform.localScale; acceptanceType = shape.AcceptanceType; }
private GameObject InstantiateShape(ShapeType shapeType, AcceptanceType acceptanceType) { var acceptanceTypeCount = Enum.GetNames(typeof(AcceptanceType)).Length; var newGameObject = Instantiate(shapePrefabs[((int)acceptanceType * acceptanceTypeCount) + (int)shapeType], Global.farPosition, Quaternion.identity); if (acceptanceType == AcceptanceType.Acceptable) { newGameObject.AddComponent <AcceptableShape>().AcceptanceType = AcceptanceType.Acceptable; } else if (acceptanceType == AcceptanceType.UnAcceptable) { newGameObject.AddComponent <UnAcceptableShape>().AcceptanceType = AcceptanceType.UnAcceptable; } else { newGameObject.AddComponent <FillerShape>().AcceptanceType = AcceptanceType.None; } return(newGameObject); }
public void Respond(string organizationObjectId, AcceptanceType acceptType) { ORC.PlacerOrderNumber.UniversalID.Value = organizationObjectId; ORC.OrderControlCodeReason.Text.Value = acceptType.ToString(); switch (acceptType) { case AcceptanceType.Accepted: ORC.OrderControl.Value = OrderControlCode.OK.ToString(); ORC.OrderStatus.Value = OrderStatus.IP.ToString(); break; case AcceptanceType.Declined: ORC.OrderControl.Value = OrderControlCode.UA.ToString(); ORC.OrderStatus.Value = OrderStatus.CA.ToString(); break; } var theDateTime = DateTime.UtcNow; ORC.DateTimeOfTransaction.Time.SetLongDate(theDateTime); MSH.DateTimeOfMessage.Time.SetLongDate(theDateTime); }
public GameObject GetShapeGameObject(ShapeType shapeType, AcceptanceType acceptanceType) { var key = shapeType + acceptanceType.ToString(); if (shapes.ContainsKey(key)) { List <GameObject> shapeList = shapes[key]; if (shapeList.Count == 0) { return(InstantiateShape(shapeType, acceptanceType)); } else { GameObject willReturn = shapeList[shapeList.Count - 1]; shapeList.RemoveAt(shapeList.Count - 1); willReturn.gameObject.SetActive(true); return(willReturn); } } else { return(InstantiateShape(shapeType, acceptanceType)); } }