Beispiel #1
0
 void Start()
 {
     this._currentHealth = this.MaxHealth;
     this.UpdateHealthBar();
     this.GetComponent <Rigidbody2D>().freezeRotation = true;
     this._sprite          = GetComponent <SpriteRenderer>();
     this._animator        = GetComponent <Animator>();
     this._movement        = new Movement(this.transform, this._animator);
     this._movement.Speed *= 0.9f;
     this._pointFollower   = new PointFollower(this.PointToFollow, this.Center, true);
     this._fireController  = GetComponentInChildren <FireController>();
 }
        void OnEnable()
        {
            skeletonRenderer    = serializedObject.FindProperty("skeletonRenderer");
            slotName            = serializedObject.FindProperty("slotName");
            pointAttachmentName = serializedObject.FindProperty("pointAttachmentName");

            targetPointFollower = (PointFollower)target;
            if (targetPointFollower.skeletonRenderer != null)
            {
                targetPointFollower.skeletonRenderer.Initialize(false);
            }

            if (!targetPointFollower.IsValid || needsReset)
            {
                targetPointFollower.Initialize();
                targetPointFollower.LateUpdate();
                needsReset = false;
                SceneView.RepaintAll();
            }
        }
Beispiel #3
0
 void Start()
 {
     pointFollower     = GetComponent <PointFollower>();
     antPointManager   = GameObject.Find("Ant Points").GetComponent <MiniBugs_AntPointManager>();
     lastPointPosition = transform.position;
 }
Beispiel #4
0
 // Start is called before the first frame update
 void Awake()
 {
     follower = GetComponent <PointFollower>();
 }