Ejemplo n.º 1
0
    void Start()
    {
        isImmortal  = false;
        myCol       = gameObject.GetComponent <Collider>();
        anim        = gameObject.GetComponent <Animator>();
        statContol  = GetComponent <StatContol>();
        audioSource = gameObject.GetComponent <AudioSource>();
        playerCon   = gameObject.GetComponent <CharecterControl>();
        if (model != null)
        {
            normalMesh = model.material;
        }
        // hpCurrent = hpMax;
        rb = gameObject.GetComponent <Rigidbody>();
        if (playerCon != null)
        {
            ultimateManager = playerCon.GetUltiManager();
        }

        if (gameObject.tag != "Player")
        {
            id = -1;
        }

        hpCurrent = hpMax;
        if (hpRing != null)
        {
            hpRing.updateGauge(hpMax, hpCurrent);
        }

        if (hpMax == 0 || hpCurrent == 0)
        {
            Debug.Log(gameObject.name + "<=start at 0 hp");
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    private void OnTriggerEnter(Collider other)
    {
        CharecterControl cc = other.GetComponent <CharecterControl>();

        if (cc != null && !alreadySpawned && other.tag == "Player")
        {
            GameObject spwn = Instantiate(goblinTent, spwnPos.position, Quaternion.identity);
            spwn.transform.parent = transform;
            alreadySpawned        = true;
        }
    }