Наследование: MonoBehaviour
Пример #1
0
    void Start()
    {
        currentHP       = hp;
        currentFloating = transform.root.GetComponent <Floating>();
        SetColorCup();
        if (projectileType == ThrowerType.Beer)
        {
            sp = GameObject.Find("BeerPool").GetComponent <SimplePooling>();
        }
        else if (projectileType == ThrowerType.Flipflop)
        {
            sp = GameObject.Find("FlipflopPool").GetComponent <SimplePooling>();
        }
        if (projectileType == ThrowerType.Mic)
        {
            sp = GameObject.Find("MicPool").GetComponent <SimplePooling>();
        }
        if (projectileType == ThrowerType.Plate)
        {
            sp = GameObject.Find("PlatePool").GetComponent <SimplePooling>();
        }
        if (projectileType == ThrowerType.Redcup)
        {
            sp = GameObject.Find("RedcupPool").GetComponent <SimplePooling>();
        }
        if (projectileType == ThrowerType.Speaker)
        {
            sp = GameObject.Find("SpeakerPool").GetComponent <SimplePooling>();
        }
        if (projectileType == ThrowerType.Money)
        {
            sp = GameObject.Find("MoneyPool").GetComponent <SimplePooling>();
        }
        if (projectileType == ThrowerType.Coffin)
        {
            sp = GameObject.Find("CoffinPool").GetComponent <SimplePooling>();
        }



        rb = gameObject.GetComponent <Rigidbody>();
        if (danceID != -1)
        {
            anim.SetInteger("DanceID", danceID);
        }
        else
        {
            anim.SetInteger("DanceID", Random.Range(0, 3));
        }
    }
Пример #2
0
 private void Start()
 {
     body       = GetComponent <Rigidbody>();
     poolSystem = FindObjectOfType <SimplePooling>();
 }
Пример #3
0
 private void Start()
 {
     poolSystem = FindObjectOfType <SimplePooling>();
     poolSystem.PoolInstaller(numPreparedObjects);
 }