コード例 #1
0
    public override void Use()
    {
        EquipmentGUI w = GameObject.FindObjectOfType <EquipmentGUI>();

        w.AddWeapon(this);
        //     w.AddPrimary(this);
    }
コード例 #2
0
        public static void NewGame()
        {
            Objects      = new List <GameObject> ();
            Map          = new Tile[MAP_WIDTH, MAP_HEIGHT];
            Log          = new List <Message>();
            abilityGUI   = new AbilityGUI();
            statusGUI    = new StatusGUI();
            equipmentGUI = new EquipmentGUI(5);
            inventoryGUI = new InventoryGUI();

            Map = MapMaker.MakeTunnelMap(false);

            miniMap = new MiniMap(30, 20, Map);

            PlayerObject               = new GameObject(StartPosition.x, StartPosition.y, "hero", 120, 200, (int)(0.05 * Game1.WIDTH - 124.21), (int)(0.61 * Game1.HEIGHT - 670));
            PlayerObject.Player        = new Player(10);
            PlayerObject.Player.Owner  = PlayerObject;
            PlayerObject.Fighter       = new Fighter(2, 5, 0, 0);
            PlayerObject.Fighter.Owner = PlayerObject;

            Objects.Add(PlayerObject);
            DeathScreen.OnStart();
            Started  = true;
            ToRemove = new List <GameObject>();

            GoToPlaying();

            //Console.Out.WriteLine(PlayerObject.x.ToString() + ";" + PlayerObject.y.ToString());
            //Console.Out.WriteLine("Position : " + PlayerObject.Position.x.ToString() + ";" + PlayerObject.Position.y.ToString());
            //Console.Out.WriteLine("InventoryWidth:" + InventoryWidth.ToString());
        }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     GUI = EquipmentGUI.instance;
     if (SecondaryWeapon != null)
     {
         //GUI.AddSecondary(SecondaryWeapon.gameObject);
         SecondaryWeapon.gameObject.SetActive(false);
     }
     if (EquippedWeapon != null)
     {
         //GUI.AddPrimary(EquippedWeapon.gameObject);
         EquippedWeapon.gameObject.SetActive(true);
     }
 }
コード例 #4
0
 private void Awake()
 {
     instance = this;
 }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     m_Inventory = this.transform.Find("InventoryGUI").gameObject.GetComponent<InventoryGUI>();
     m_LootWindow = this.transform.Find("LootWindowGUI").gameObject.GetComponent<LootWindowGUI>();
     m_Backpack = this.transform.Find("BackpackGUI").gameObject.GetComponent<BackpackGUI>();
     m_Equipment = this.transform.Find("EquipmentGUI").gameObject.GetComponent<EquipmentGUI>();
     m_ItemDrag = this.transform.Find("ItemDragGUI").gameObject.GetComponent<ItemDragGUI>();
 }