示例#1
0
    public void ClearHB()
    {
        if (hb != null)
        {
            hb.onListChange          = null;
            hb.onTemporaryListChange = null;
        }

        hb = null;
    }
    public void Fill(HeroBehaviorDisplay display, HeroBehavior hb, HBD_ActionList tempList, HBD_ActionList loopList, HBD_TemplateAction templateAction)
    {
        existingAction = templateAction.actionClone;
        this.loopList  = loopList;
        this.tempList  = tempList;
        this.display   = display;
        this.hb        = hb;
        createNew      = true;

        SharedFill();
    }
    public void Fill(HeroBehaviorDisplay display, HeroBehavior hb, HBD_ActionList tempList, HBD_ActionList loopList, HBD_Action action)
    {
        existingAction = action.action;
        this.loopList  = loopList;
        this.tempList  = tempList;
        this.display   = display;
        this.hb        = hb;
        createNew      = false;

        SharedFill();
    }
示例#4
0
 // Use this for initialization
 void Start()
 {
     cameraDown          = new Rect(0, 0, Screen.width, guiSize);
     cameraUp            = new Rect(0, Screen.height - guiSize, Screen.width, guiSize);
     cameraLeft          = new Rect(0, 0, guiSize, Screen.height);
     cameraRight         = new Rect(Screen.width - guiSize, 0, guiSize, Screen.height);
     heroBehaviour       = hero.GetComponent <HeroBehavior>();
     heroMovementControl = hero.GetComponent <MovementControl>();
     clickingMarker      = Instantiate(Resources.Load("ClickingMarker"), heroMovementControl.Position, Quaternion.identity) as GameObject;
     clickingMarker.SetActive(false);
     team = "BlueTeam";
 }
示例#5
0
    public void Fill(Hero hero)
    {
        ClearHB();

        hb = hero.behavior;
        hb.onListChange          = ReFill;
        hb.onTemporaryListChange = ReFill;

        templates.Fill(hb.GetPossibleActionList());

        tempList.Fill(GetTemporaryActions());

        loopList.Fill(GetLoopActions());
    }
示例#6
0
 static int OnRecycle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         HeroBehavior obj = (HeroBehavior)ToLua.CheckObject(L, 1, typeof(HeroBehavior));
         obj.OnRecycle();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#7
0
 static int RemoveCameraEffect(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         HeroBehavior obj  = (HeroBehavior)ToLua.CheckObject(L, 1, typeof(HeroBehavior));
         string       arg0 = ToLua.CheckString(L, 2);
         obj.RemoveCameraEffect(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#8
0
 static int UpdateLogic(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         HeroBehavior obj  = (HeroBehavior)ToLua.CheckObject(L, 1, typeof(HeroBehavior));
         float        arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.UpdateLogic(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#9
0
 static int CastCameraEffect(IntPtr L)
 {
     try
     {
         int          count = LuaDLL.lua_gettop(L);
         HeroBehavior obj   = (HeroBehavior)ToLua.CheckObject(L, 1, typeof(HeroBehavior));
         string       arg0  = ToLua.CheckString(L, 2);
         object[]     arg1  = ToLua.ToParamsObject(L, 3, count - 2);
         obj.CastCameraEffect(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#10
0
    public HeroBehavior CreateHero(uint sceneid, string uid, int entityType, GameObject go)
    {
        HeroBehavior hero = go.GetComponent <HeroBehavior>();

        if (hero == null)
        {
            hero = go.AddComponent <HeroBehavior>();
        }
        hero.uid        = uid;
        hero.entityType = entityType;
        hero.sceneid    = sceneid;

        entityBehaviors.Add(uid, hero);
        hero.OnNewObject();

        return(hero);
    }
示例#11
0
 static int CreateHero(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         EntityBehaviorMgr obj       = (EntityBehaviorMgr)ToLua.CheckObject(L, 1, typeof(EntityBehaviorMgr));
         uint   arg0                 = (uint)LuaDLL.luaL_checknumber(L, 2);
         string arg1                 = ToLua.CheckString(L, 3);
         int    arg2                 = (int)LuaDLL.luaL_checknumber(L, 4);
         UnityEngine.GameObject arg3 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 5, typeof(UnityEngine.GameObject));
         HeroBehavior           o    = obj.CreateHero(arg0, arg1, arg2, arg3);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#12
0
    public void Init(HeroBehavior behavior)
    {
        ShowPanel();
        display.Fill(behavior.hero);

        display.nodeRequest = (HeroBehaviorDisplay.NodeEvent callback) =>
        {
            selectNodeNotif.gameObject.SetActive(true);
            SemiHide();
            selectNodeNotif.screenClicked.AddListener((Vector2 clickPos) =>
            {
                callback(Game.Fastar.GetClosestNode(clickPos));
                ShowPanel();
                selectNodeNotif.screenClicked.RemoveAllListeners();
                selectNodeNotif.gameObject.SetActive(false);
            });
        };

        Game.HeroManager.onActiveHeroChanged += display.Fill;
    }
        private void Start()
        {
            if (instance != null && instance != this)
            {
                Debug.LogError("Duplicate Dungeon Manager detected: removing " + this.gameObject.name);
                Destroy(this.gameObject);
                return;
            }

            instance = this;

            // Ensure Pools are fully initialized before starting the map
            ObjectPooling.ObjectPool[] pools = FindObjectsOfType <ObjectPooling.ObjectPool>() as ObjectPooling.ObjectPool[];
            foreach (ObjectPooling.ObjectPool pool in pools)
            {
                pool.Init();
            }

            this.hero = GetHero().GetComponent <HeroBehavior>();

            this.cameraTracker   = FindObjectOfType <Util.CameraTracker>();
            this.titleScreenDemo = GetComponent <TitleScreenDemo>();
            StartCoroutine(SwitchMaps());
        }
示例#14
0
 private void Start()
 {
     this.hero         = FindObjectOfType <HeroBehavior>();
     this.currentIndex = 0;
     this.image.sprite = sprites[0];
 }
示例#15
0
 private void Start()
 {
     this.hero         = Managers.DungeonManager.GetHero().GetComponent <HeroBehavior>();
     this.currentIndex = 0;
     this.image.sprite = sprites[0];
 }
示例#16
0
 private void Start()
 {
     this.hero         = Managers.DungeonManager.GetHero().GetComponent <HeroBehavior>();
     this.currentIndex = 0;
     this.sprites[0].SetActive(true);
 }
示例#17
0
 private void Start()
 {
     this.hero             = Managers.DungeonManager.GetHero().GetComponent <HeroBehavior>();
     this.originalPosition = bar.anchoredPosition;
     this.originalScale    = this.transform.localScale;
 }
示例#18
0
 private void Start()
 {
     this.hero             = FindObjectOfType <HeroBehavior>();
     this.originalPosition = bar.anchoredPosition;
     this.originalScale    = this.transform.localScale;
 }
示例#19
0
 private void Start()
 {
     heroBehavior = transform.parent.GetComponent <HeroBehavior>();
 }