public void SetSprite(WorkerModel model) { AgentAnim anim = null; if (model is AgentModel) { AgentUnit unit = AgentLayer.currentLayer.GetAgent(model.instanceId); anim = unit.animTarget; this.Symbol.gameObject.SetActive(true); } else if (model is OfficerModel) { OfficerUnit unit = OfficerLayer.currentLayer.GetOfficer(model.instanceId); anim = unit.animTarget; this.Symbol.gameObject.SetActive(false); } this.Face.sprite = anim.face.sprite; this.Hair.sprite = anim.hair.sprite; this.Body.sprite = anim.body.sprite; this.LeftDownArm.sprite = anim.B_low_arm.sprite; this.LeftUpArm.sprite = anim.B_up_arm.sprite; this.RightDownArm.sprite = anim.F_low_arm.sprite; this.RightUpArm.sprite = anim.F_up_arm.sprite; this.LeftDownLeg.sprite = anim.B_low_leg.sprite; this.LeftUpLeg.sprite = anim.B_up_leg.sprite; this.RightDownLeg.sprite = anim.F_low_leg.sprite; this.RightUpLeg.sprite = anim.F_up_leg.sprite; }
void Shoot(WorkerModel target) { if (!_isEnabled) { return; } SetPos(this.endPos.transform.position); //공격판정 if (target == null) { script.FailAttack(); LaserDisable(); //Debug.Log("1"); return; } if (target.isDead() == false) { if (target.GetMovableNode().GetPassage() == movable.GetPassage()) { target.TakePhysicalDamageByCreature(1f); AgentAnim targetAnim = null; if (target is AgentModel) { targetAnim = AgentLayer.currentLayer.GetAgent(target.instanceId).animTarget; } else { targetAnim = OfficerLayer.currentLayer.GetOfficer(target.instanceId).animTarget; } targetAnim.TakeDamageAnim(1); script.SuccessAttack(); int cnt = 0; foreach (WorkerModel wm in this.targetList) { if (wm.isDead() == false) { cnt++; } } if (cnt == 0) { LaserDisable(); //Debug.Log("2"); } return; } } script.FailAttack(); LaserDisable(); //Debug.Log("3"); }