Beispiel #1
0
 // Use this for initialization
 void Awake()
 {
     body        = GetComponent <Rigidbody2D>();
     rend        = playerObject.GetComponent <Renderer>();
     anim        = GetComponent <Animator>();
     respawnPos  = transform.position;
     col         = GetComponent <CircleCollider2D>();
     source      = gameObject.AddComponent <AudioSource>();
     mover       = PlayerMover.Attach(gameObject, maxLength);
     painter     = PlayerPainter.Attach(gameObject, rend);
     source.clip = fallSound;
 }
Beispiel #2
0
 protected override void Awake()
 {
     base.Awake();
     if (playerPainter == null)
         playerPainter = gameObject.GetComponent<PlayerPainter>();
 }