예제 #1
0
    public static void CreatExpandCircle(Vector3 pos, Color col)
    {
        ExpandCircle circle = Instantiate(Resource.GetInstance().expandCircle, pos, Quaternion.identity);

        circle.color  = col;
        circle.sprite = circle.GetComponent <SpriteRenderer>();
    }
예제 #2
0
 private void Start()
 {
     land = transform.GetComponentInParent <Land>();
     healthBar.gameObject.SetActive(false);
     land.OnHealthDamage += (object s, EventArgs e) => {
         healthBar.gameObject.SetActive(true);
         healthBar.fillAmount = land.GetHealthRate();
     };
     land.OnBelongDamage += (object s, EventArgs e) => {
         belongBar.color      = land.GetAttackerColor();
         belongBar.fillAmount = land.GetBelongRate();
     };
     land.OnBelongPlayerChange += (object s, EventArgs e) => {
         belongBar.color = land.GetPlayer().GetColor();
         ExpandCircle.CreatExpandCircle(transform.position, land.GetPlayer().GetColor());
     };
 }