Exemplo n.º 1
0
 void SetupUtility()
 {
     myUtility = (GameObject)Instantiate(movementUtility, Vector3.zero, Quaternion.identity);
     myUtility.transform.parent = gm.transform.GetChild(0).transform;
     myMovementReference = myUtility.transform.GetChild(5);
     movementRefForward = myUtility.transform.GetChild(3);
     movementRefBackward = myUtility.transform.GetChild(4);
     nodeScript = myUtility.GetComponentInChildren<PathNodeJumper>();
     nodeScript.objectToSet = transform;
     nodeScript.pathName = myPath;
     nodeScript.checkTime = myCheckTime;
     nodeScript.objectPathPosition = myStartPercentage;
 }
    void Start () {

        if (toSet == null)
            toSet = transform;
        if (!ladder)
            pathMovementScript = GetComponent<PathNodeJumper>();
        else
            ladderPath = GetComponent<MoveAlongPath>();
        referenceTransform = new GameObject().transform;
        referenceTransform.transform.name = "PathRotationReferenceTransform";
        if (alignToPath)
            StartingLookPosition(true);
        else if (lookAtTarget)
            StartingLookPosition(false);
    }