Ejemplo n.º 1
0
    public void ObjectMonster(S.ObjectMonster p)
    {
        MapObject     ob;
        MonsterObject monster;

        if (ObjectList.TryGetValue(p.ObjectID, out ob))
        {
            monster                          = (MonsterObject)ob;
            monster.Name                     = p.Name;
            monster.CurrentLocation          = new Vector2(p.Location.X, p.Location.Y);
            monster.Direction                = p.Direction;
            monster.transform.position       = CurrentScene.Cells[p.Location.X, p.Location.Y].position;
            monster.Model.transform.rotation = ClientFunctions.GetRotation(p.Direction);
            monster.gameObject.SetActive(true);
            if (p.Dead)
            {
                monster.Dead          = true;
                monster.CurrentAction = MirAction.Dead;
            }
            else
            {
                CurrentScene.Cells[p.Location.X, p.Location.Y].AddObject(monster);
            }
            return;
        }

        if ((int)p.Image >= MonsterModels.Count)
        {
            monster = Instantiate(MonsterModels[0], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity).GetComponent <MonsterObject>();
        }
        else
        {
            monster = Instantiate(MonsterModels[(int)p.Image], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity).GetComponent <MonsterObject>();
        }
        monster.Name                     = p.Name;
        monster.ObjectID                 = p.ObjectID;
        monster.Scale                    = p.Scale;
        monster.CurrentLocation          = new Vector2(p.Location.X, p.Location.Y);
        monster.Direction                = p.Direction;
        monster.Model.transform.rotation = ClientFunctions.GetRotation(p.Direction);

        if (p.Dead)
        {
            monster.Dead          = true;
            monster.CurrentAction = MirAction.Dead;
        }
        else
        {
            CurrentScene.Cells[p.Location.X, p.Location.Y].AddObject(monster);
        }
        ObjectList.Add(p.ObjectID, monster);
    }
Ejemplo n.º 2
0
    public void ObjectMonster(S.ObjectMonster p)
    {
        MapObject     ob;
        MonsterObject monster;

        if (ObjectList.TryGetValue(p.ObjectID, out ob))
        {
            monster                          = (MonsterObject)ob;
            monster.Name                     = p.Name;
            monster.NameColour               = ConvertSystemColor(p.NameColour);
            monster.CurrentLocation          = new Vector2Int(p.Location.X, p.Location.Y);
            monster.Direction                = p.Direction;
            monster.transform.position       = CurrentScene.Cells[p.Location.X, p.Location.Y].position;
            monster.Model.transform.rotation = ClientFunctions.GetRotation(p.Direction);
            monster.gameObject.SetActive(true);
            monster.Dead     = p.Dead;
            monster.Blocking = !p.Dead;
            monster.Class    = p.MobClass;
            return;
        }

        if ((int)p.Image >= MonsterModels.Count)
        {
            monster = Instantiate(MonsterModels[0], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity).GetComponent <MonsterObject>();
        }
        else
        {
            monster = Instantiate(MonsterModels[(int)p.Image], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity).GetComponent <MonsterObject>();
        }
        monster.Name                     = p.Name;
        monster.NameColour               = ConvertSystemColor(p.NameColour);
        monster.ObjectID                 = p.ObjectID;
        monster.Scale                    = p.Scale;
        monster.CurrentLocation          = new Vector2Int(p.Location.X, p.Location.Y);
        monster.Direction                = p.Direction;
        monster.Model.transform.rotation = ClientFunctions.GetRotation(p.Direction);
        monster.OutlineMaterial          = OutlineMaterial;
        monster.Dead                     = p.Dead;
        monster.Blocking                 = !p.Dead;
        monster.Class                    = p.MobClass;

        CurrentScene.Cells[p.Location.X, p.Location.Y].AddObject(monster);
        ObjectList.Add(p.ObjectID, monster);

        monster.BossUI(monster);
    }
Ejemplo n.º 3
0
 public static void ObjectMonster(S.ObjectMonster p)
 {
     gameManager.ObjectMonster(p);
 }