// Use this for initialization void Start() { textPopper = GameObject.Find("TextPopper").GetComponent <SimpleTextPopper>(); audioMan = GameObject.FindObjectOfType <AudioManager>(); controlHistory = new List <InputHistoryEntry>(); //set up camera target GetComponentInChildren <Rigidbody2D>().GetComponent <SpringJoint2D>().connectedBody = transform.parent.GetComponent <Rigidbody2D>(); TogglePause(false); }
// Use this for initialization void Start() { textPopper = GameObject.FindObjectOfType <SimpleTextPopper>(); if (transform.childCount > 0) { textPosition = transform.GetChild(0).gameObject; //only child is where to put it } else { textPosition = new GameObject("txtpos"); textPosition.transform.parent = transform; textPosition.transform.localPosition = Vector3.zero; } unusedRepeats = randomRepeats; }
// Use this for initialization void Start() { //set up references myRB2 = GetComponent <Rigidbody2D>(); mySprite = GetComponent <SpriteRenderer>(); myAnim = GetComponent <Animator>(); myAnim.SetInteger("Vertical", -1); //try to find player player = GameObject.FindObjectOfType <PlayerController>(); if (player == null) { Debug.Log("AIScript: Player object not found!"); } //try to get text popper textPopper = GameObject.FindObjectOfType <SimpleTextPopper>(); if (textPopper == null) { Debug.Log("AIScript: textpopper object not found!"); } audioMan = GameObject.FindObjectOfType <AudioManager>(); //initialize input dirInput = Vector2.zero; if (GetComponentInChildren <PlayerController>() != null) //look at me, i'm the player now! { isPlayerControlled = true; } else { aura.GetComponent <SpriteRenderer>().enabled = false; } targets = new List <GameObject>(); }
// Use this for initialization void Start () { popper = GameObject.FindObjectOfType<SimpleTextPopper>().GetComponent<SimpleTextPopper>(); }