Exemple #1
0
        public void Dispose()
        {
            MainCharacterRenderer?.Dispose();
            MainCharacterRenderer = null;

            foreach (var renderer in CharacterRenderers.Values)
            {
                renderer.Dispose();
            }
            CharacterRenderers.Clear();
        }
Exemple #2
0
    private void Awake()
    {
        rbody       = GetComponent <Rigidbody2D>();
        isoRenderer = GetComponentInChildren <MainCharacterRenderer>();

        foreach (Sound sound in sounds)
        {
            sound.source      = gameObject.AddComponent <AudioSource>();
            sound.source.clip = sound.clip;
        }
    }