示例#1
0
    public BossRunState(MonsterFacade _monster, int model)
    {
        this._monster = _monster;
        this.model    = model;
        rig           = _monster.trs.GetComponent <Rigidbody2D>();
        float playerdis = _monster.trs.position.x - _monster.playerTrs.position.x;

        if (playerdis < 0)
        {
            if (_monster.trs.rotation.y == 0)
            {
                _monster.trs.Rotate(new Vector3(0, 180, 0));
            }
        }
        else if (playerdis > 0)
        {
            if (_monster.trs.rotation.y != 0)
            {
                _monster.trs.Rotate(new Vector3(0, -180, 0));
            }
        }
        if (model == 0)
        {
            rig.velocity = new Vector2(_monster.trs.rotation.y == 0 ? -7 : 7, 0);
        }
        else if (model == 1)
        {
            p1 = _monster.trs.position;

            p1.x = playerdis > 0 ? _monster.playerTrs.position.x + 1.0f : _monster.playerTrs.position.x - 0.5f;
        }
    }
示例#2
0
 public BotAttackState(MonsterFacade _monster)
 {
     this._monster = _monster;
     t1            = 0;
     finishAdd     = false;
     go            = false;
 }
示例#3
0
 public BossIdleState(MonsterFacade _monster, float time)
 {
     this._monster  = _monster;
     nowTime        = 0;
     isInWall       = false;
     this.ThinkTime = time;
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     anim     = transform.GetComponent <Animator>();
     trs      = transform.GetComponent <Transform>();
     spR      = transform.GetComponent <SpriteRenderer>();
     playerGb = GameObject.Find("idle_0") as GameObject;
     _monster = new MonsterFacade(anim, trs, index, trs.position, playerGb.GetComponent <Transform>());
 }
示例#5
0
 public m1RunState(MonsterFacade _monster)
 {
     this._monster = _monster;
     p2            = p1 = _monster.pos;
     p1.x         -= _monster.trs.GetComponent <MonsterControll>().moveRange;
     p2.x         += _monster.trs.GetComponent <MonsterControll>().moveRange;
     maxMove       = _monster.trs.GetComponent <MonsterControll>().moveRange - 0.2f;
 }
示例#6
0
        public async Task <ActionResult> Create()
        {
            ViewBag.Items = await EquipmentFacade.GetAllItemsAsync();

            ViewBag.Monsters = await MonsterFacade.GetAllMonstersAsync();

            return(View("~/Views/Admin/Quest/Create.cshtml"));
        }
示例#7
0
 public DogWalkState(MonsterFacade _monster)
 {
     this._monster = _monster;
     p2            = p1 = _monster.pos;
     p1.x         -= _monster.trs.GetComponent <MonsterControll>().moveRange;
     p2.x         += _monster.trs.GetComponent <MonsterControll>().moveRange;
     maxMove       = _monster.trs.GetComponent <MonsterControll>().moveRange - 0.6f;
     ThinkTime     = 0;
 }
        // GET: DashBoard
        public async Task <ActionResult> Index()
        {
            var itemsList = (await EquipmentFacade.GetAllItemsAsync()).ToList();

            ViewBag.Items     = itemsList.Count(a => a.ShopId == null);
            ViewBag.ShopItems = itemsList.Count(a => a.ShopId != null);
            ViewBag.Monsters  = (await MonsterFacade.GetAllMonstersAsync()).Count();
            ViewBag.Quests    = (await QuestFacade.GetAllQuestsAsync()).Count();
            ViewBag.Mini      = (await MiniLocationFacade.GetAllItemsAsync()).Count();
            ViewBag.Locations = (await LocationFacade.GetAllAsync()).Count();
            return(View());
        }
示例#9
0
    public m1AttackState(MonsterFacade _monster)
    {
        this._monster = _monster;
        float playerdis = _monster.trs.position.x - _monster.playerTrs.position.x;

        if (playerdis < 0 && _monster.trs.rotation.y == 0)
        {
            _monster.trs.Rotate(new Vector3(0, 180, 0));
        }
        else if (playerdis > 0 && _monster.trs.rotation.y != 0)
        {
            _monster.trs.Rotate(new Vector3(0, -180, 0));
        }
        if (_monster.anim.GetFloat("Num") == 1)
        {
            GameObject gb = GameObject.Instantiate(Resources.Load <GameObject>("Bullet/Empty"));
            gb.transform.parent = _monster.trs;
            gb.tag = _monster.trs.rotation.y == 0 ? "leftgb" : "rightgb";
            gb.transform.localPosition = (new Vector2(-0.1f, 0.25f));
            gb.transform.parent        = null;
        }
    }
示例#10
0
    public BossAttackState(MonsterFacade _monster, int model)
    {
        this._monster = _monster;
        this.model    = model;
        rig           = _monster.trs.GetComponent <Rigidbody2D>();
        float playerdis = _monster.trs.position.x - _monster.playerTrs.position.x;

        isEnd = false;
        if (playerdis < 0)
        {
            if (_monster.trs.rotation.y == 0)
            {
                _monster.trs.Rotate(new Vector3(0, 180, 0));
            }
        }
        else if (playerdis > 0)
        {
            if (_monster.trs.rotation.y != 0)
            {
                _monster.trs.Rotate(new Vector3(0, -180, 0));
            }
        }
    }
示例#11
0
 public m1IdleState(MonsterFacade _monster)
 {
     this._monster = _monster;
     ThinkTime     = 0;
 }
示例#12
0
 public DogAttackState(MonsterFacade _monster)
 {
     this._monster = _monster;
     isFinish      = false;
 }