Пример #1
0
        public void Setup()
        {
            _manager = new Mock <ChildManager>();
            _testFactory.GenerateNewDocumentStore();

            SUT = new ChildController(_testFactory.CurrentUser, _manager.Object, _testFactory.TestLogger());
        }
Пример #2
0
 public void setChildrenController()
 {
     if (jsonNode["_hasChildren"].AsBool)
     {
         myChildrenController = transform.FindChild("childContainer").GetComponent <ChildController>();
     }
 }
Пример #3
0
 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");
     }
 }
Пример #4
0
    void UpdateGameState()
    {
        GameObject childObject = GameObject.FindGameObjectWithTag("ActiveChild");

        if (childObject)
        {
            activeChild = childObject.GetComponent <ChildController>();
        }
    }
Пример #5
0
 private void OnTriggerExit2D(Collider2D other)
 {
     enteredInteractableObject = false;
     currentChildController    = null;
     if (grapplingHookController != null)
     {
         grapplingHookController.Active = false;
         grapplingHookController        = null;
     }
     repairPointController = null;
 }
Пример #6
0
        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;
            }
        }
Пример #7
0
    // 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");
         */
    }
Пример #8
0
    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;
    }
Пример #9
0
 public void Teardown()
 {
     SUT = null;
 }
Пример #10
0
 // Use this for initialization
 void Start()
 {
     childController = GetComponent<ChildController>();
 }
Пример #11
0
 // Start is called before the first frame update
 void Start()
 {
     childController = GetComponent <ChildController>();
 }