示例#1
0
    private void Start()
    {
        animator       = GetComponentInChildren <Animator>();
        shaker         = GetComponentInChildren <Shaker>();
        spriteRenderer = GetComponentInChildren <SpriteRenderer>();

        bar = Instantiate(barPrefab, StageGUI.Instance.transform).GetComponent <Counterbar>();
        bar.transform.SetAsFirstSibling();
        bar.SetValue(MaxHealth);
        bar.GetComponent <FollowerGUI>().SetTarget(transform);

        AudioController.Instance.PlaySound("dummy_thump");
    }
示例#2
0
    private void Start()
    {
        index = lastIndex++;

        usables = GetComponentsInChildren <Usable>();

        bar = Instantiate(healthBar, StageGUI.Instance.transform).GetComponent <Counterbar>();
        bar.SetValue(MaxHealth);
        bar.GetComponent <FollowerGUI>().SetTarget(transform);
        bar.transform.SetAsFirstSibling();

        GetComponentInChildren <Animator>().runtimeAnimatorController = animControllers[index];

        arrowSprite.color = Color;

        controls.Horizontal = "Horizontal_" + index;
        controls.Vertical   = "Vertical_" + index;
        controls.Attack     = "Attack_" + index;
        controls.Cycle      = "Cycle_" + index;

        rigidbody = GetComponent <Rigidbody>();

        EventManager.QueueEvent(new KidSpawnedEvent(this));
    }