public override void Damage(bool value) { base.Damage(damageCom); HittedMatEffect sc = gameObject.GetComponent <HittedMatEffect>(); if (null == sc) { sc = gameObject.AddComponent <HittedMatEffect>(); } sc.Active(); sc.SetColor(Color.red); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { HittedMatEffect sc = gameObject.GetComponent <HittedMatEffect>(); if (null == sc) { sc = gameObject.AddComponent <HittedMatEffect>(); } sc.Active(); sc.SetColor(Color.red); } }