protected override void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } base.Awake(); }
private void ClearRemaingObjects() { PaintPool paintPool = PaintPool.GetInstance(); GameObject[] decals = GameObject.FindGameObjectsWithTag("Decal"); foreach (GameObject decal in decals) { paintPool.ReturnToPool(decal); } Head[] heads = FindObjectsOfType <Head>(); foreach (Head head in heads) { Destroy(head.gameObject); } }
private void MakeUp(bool paintState) { if (paintState) { if (treatmentType != TreatmentType.MakeUp) { treatmentType = TreatmentType.MakeUp; ClearPreviousTreatments(treatmentType); } } else { ObjectPool pool = PaintPool.GetInstance(); List <GameObject> paintList = GetAllDecals(); foreach (GameObject paint in paintList) { pool.ReturnToPool(paint); } } }
private void Start() { pool = GetComponent <PaintPool>(); }