Пример #1
0
    void Start()
    {
        gear     = GetComponent <PlayerGear>();
        anim     = GetComponent <Animator>();
        stats    = GetComponent <StickStats>();
        movement = GetComponent <MovementController>();
        cursor   = GameObject.FindObjectOfType <CursorTag>().gameObject;
        registry = GameObject.FindObjectOfType <Registry>().GetComponent <Registry>();
        registry.damageAcceptors.AddDamageAcceptor(this);
        slevel         = GetComponent <SticknessLevel>();
        ui             = GameObject.Find("UI");
        deadStickyNote = ui.transform.Find("DeadStickyNote").gameObject;

        gpParent    = GameObject.Find("GeneralPurposeParent");
        health      = ui.transform.Find("Health").GetComponent <Text>();
        health.text = ((int)(stats.currentHitPoints)).ToString();

        originalMoveSpeed = movement.moveSpeed;
        originalJumpSpeed = movement.jumpSpeed;

        groups = new List <string>();
        groups.Add("players");
        stats.currentHitPoints   = stats.totalHitPoints;
        stats.currentArmorPoints = stats.totalArmorPoints;

        Time.timeScale = 1f;

        if (findStartPoint)
        {
            this.enabled = false;
            InvokeRepeating("WaitForStartPoint", 0.1f, 0.1f);
        }
    }
Пример #2
0
 protected void Start()
 {
     //Debug.Log("AIControl Start");
     Registry.instance.damageAcceptors.AddDamageAcceptor(this);
     groups.Add("AI");
     target = GameObject.FindObjectOfType <PlayerTag>().gameObject;
     stats  = GetComponent <StickStats>();
     if (stats != null)
     {
         stats.currentHitPoints   = stats.totalHitPoints;
         stats.currentArmorPoints = stats.totalArmorPoints;
     }
     gpParent = GameObject.Find("GeneralPurposeParent");
 }