public void Setup() { _manager = new Mock <ChildManager>(); _testFactory.GenerateNewDocumentStore(); SUT = new ChildController(_testFactory.CurrentUser, _manager.Object, _testFactory.TestLogger()); }
public void setChildrenController() { if (jsonNode["_hasChildren"].AsBool) { myChildrenController = transform.FindChild("childContainer").GetComponent <ChildController>(); } }
public void setItemParent() { if (jsonNode["_parent"] != null) { //Transform childContainer = GameObject.Find(jsonNode["_parent"]).transform.Find("childContainer"); if (GameObject.Find(jsonNode["_parent"]).transform.Find("childContainer") == null) { GameObject childContainer = new GameObject("childContainer"); childContainer.AddComponent <ChildController>(); childController = childContainer.GetComponent <ChildController>(); childContainer.transform.SetParent(GameObject.Find(jsonNode["_parent"]).transform); childContainer.transform.localPosition = Vector3.zero; } else { childController = GameObject.Find(jsonNode["_parent"]).transform.Find("childContainer").GetComponent <ChildController>(); } menuItem.transform.SetParent(GameObject.Find(jsonNode["_parent"]).transform.FindChild("childContainer").transform); } else if (jsonNode["_parent"] == null) { menuItem.transform.SetParent(GameObject.Find("MenuHolder").transform); childController = GameObject.Find("MenuHolder").GetComponent <ChildController>(); } else { Debug.Log("Parent Error"); } }
void UpdateGameState() { GameObject childObject = GameObject.FindGameObjectWithTag("ActiveChild"); if (childObject) { activeChild = childObject.GetComponent <ChildController>(); } }
private void OnTriggerExit2D(Collider2D other) { enteredInteractableObject = false; currentChildController = null; if (grapplingHookController != null) { grapplingHookController.Active = false; grapplingHookController = null; } repairPointController = null; }
private void OnTriggerEnter2D(Collider2D other) { enteredInteractableObject = true; currentChildController = other.GetComponent <ChildController>(); grapplingHookController = other.GetComponent <GrapplingHookController>(); if (grapplingHookController != null) { grapplingHookController.Active = true; } var rc = other.GetComponent <RepairPointController>(); if (rc != null && ResourceManager.Instance.ResourceCount > 0) { repairPointController = rc; } }
// POST api/wrapper public void Post(ComplexWithChild value) { var other = value.otherdata; var childcontroller = new ChildController(); childcontroller.Post(value.child); // ChildController is not initialized, and has null Request /*inside ChildController...// causes null reference exception due to null Request * Request.CreateErrorResponse(HttpStatusCode.BadRequest, "my message"); */ childcontroller.Request = this.Request; childcontroller.Post(value.child); // ChildController uses same Request /*inside ChildController...// this works now * Request.CreateErrorResponse(HttpStatusCode.BadRequest, "my message"); */ }
void InstantiateSnek() { GameObject _prefab = Instantiate(prefab); _prefab.transform.SetParent(parent); ChildController lastSnekController = lastSnek.GetComponent <ChildController>(); Vector3 pos = mainController.allDirections[lastSnekController.currentDirFollowed].vec; _prefab.transform.position = lastSnek.transform.position + (pos * offset); _prefab.GetComponent <ChildController>().currentDirFollowed = lastSnekController.currentDirFollowed; _prefab.GetComponent <ChildController>().mainSnek = mainController; lastSnek = _prefab; }
public void Teardown() { SUT = null; }
// Use this for initialization void Start() { childController = GetComponent<ChildController>(); }
// Start is called before the first frame update void Start() { childController = GetComponent <ChildController>(); }