Esempio n. 1
0
    // Use this for initialization

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
    }
Esempio n. 2
0
    void Start()
    {
        loadPrefab = LoadPrefabInGame.instance;
        // Only enemy have health bar
        if (gameObject.tag != "Player")
        {
            activeHealthBar = transform.GetChild(0);
        }

        normalMaterial = gameObject.GetComponent <SpriteRenderer>().material;
    }