Esempio n. 1
0
 public void OnMissionUpdate(EnemyClass _targetType, int _numToKill)
 {
     if (_numToKill < 0) _numToKill = 0;
     string iconName = _targetType.ToString().ToLower();
     missionTargetIcon.spanim.Play(iconName);
     missionInfoText.text = "to kill: " + _numToKill;
 }
Esempio n. 2
0
    public void InitEnemy(Vector2 spawnposition)
    {
        //생성될 캐릭터의 위치
        transform.position = spawnposition;
        //애니메이션
        SetAnimation("walk", true, 1.0f);
        //상태
        currentState = EnemyState.move;

        //xml 불러오기
        XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.Load("./Assets/Scripts/Player Character/EnemyStats.xml");

        //해당 클래스 타입 값
        XmlNode node = xmlDoc.SelectSingleNode("Character/" + enemyClass.ToString() + "/" + enemyType.ToString());


        maxHP        = float.Parse(node.SelectSingleNode("HP").InnerText);
        currentHP    = maxHP;
        AttackDamage = float.Parse(node.SelectSingleNode("AttackDamage").InnerText);
        AttackSpeed  = float.Parse(node.SelectSingleNode("AttackSpeed").InnerText);
        HitTime      = float.Parse(node.SelectSingleNode("HitTime").InnerText);
        //추후 추가 및 관리

        //hpbarposition.localPosition = Vector3.right * 1.0f + transform.position;
        //Count = 0;
        //MaxCount = int.Parse(node.SelectSingleNode("MaxCount").InnerText);
    }
        private void Start()
        {
            Enemy enemy = GetComponent <Enemy>();

            spriteRenderer = GetComponent <SpriteRenderer>();
            characterClass = enemy.characterClass;
            subSprites     = Resources.LoadAll <Sprite>("Characters/" + characterClass.ToString());
        }
Esempio n. 4
0
 void Start()
 {
     GameManager.instance.Add(this);
     transform.name = myClass.ToString();
 }