Пример #1
0
    public GameObject TryMove(Vector3 newPosition)
    {
        //////////////////////////////////////
        //Local Variables

        RaycastHit hit;

        //////////////////////////////////////

        BoxCollider.enabled = false;
        Physics.Linecast(transform.position, newPosition, out hit);
        Debug.DrawLine(transform.position, newPosition, Color.red, 10.0f);
        BoxCollider.enabled = true;

        if ((hit.transform != null) && (TraceDebugMove == true))
        {
            StaticTrace.Log(string.Format("Object name:  {0}", hit.collider.gameObject.name));
            StaticTrace.Log(string.Format("Blocked:  {0}", hit.collider.gameObject.GetComponent <Tile>().Blocked.ToString()));
        }

        if ((hit.transform == null) || (hit.collider.gameObject.GetComponent <Tile>().Blocked == false))
        {
            EnableMove   = true;
            MovePosition = newPosition;
            return(null);
        }

        else
        {
            return(hit.collider.gameObject);
        }
    }
Пример #2
0
    public void SetNameBox(string name)
    {
        if (DebugMessage == true)
        {
            StaticTrace.Log(string.Format("New NameBox:  {0}", name));
        }

        nameLabel.Content.text = name;

        ShowName = true;
    }
Пример #3
0
    public static void UpdateModel(MainAggregate updatedAggregate)
    {
        try
        {
            FindAndUpdateModel(updatedAggregate);
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
Пример #4
0
    public static void UpdatePlayerAttributesInModel(FighterAttributes attributes)
    {
        try
        {
            UpdateFighterAttributes(attributes);
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
Пример #5
0
    void Update()
    {
        try
        {
            UpdateLabels();
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
Пример #6
0
    void Start()
    {
        try
        {
            GetMainController();
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
Пример #7
0
    void OnGUI()
    {
        try
        {
            DrawLabels();
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
Пример #8
0
    public void Start(EquipmentSlotState slot, FighterAttributes fighter)
    {
        try
        {
            Unequip(slot, fighter);
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Пример #9
0
    public void Start(FighterAttributes fighter)
    {
        try
        {
            UpdateBonus(fighter);
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Пример #10
0
    public void Start(AbstractItemAI item, FighterAttributes fighter)
    {
        try
        {
            Equip(item, fighter);
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Пример #11
0
    public static void Start(int value)
    {
        try
        {
            AddValue(value);
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Пример #12
0
    public void PreserveItem()
    {
        try
        {
            TryPreserve();
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Пример #13
0
    public static InputSettings GetInputSettingsFromModel()
    {
        try
        {
            return(GetInputSettings());
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
            return(null);
        }
    }
Пример #14
0
    public static MainAggregate ReturnModel()
    {
        try
        {
            return(FindAndReturnModel());
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
            return(null);
        }
    }
Пример #15
0
    public static List <AbstractItemAI> GetItemListFromModel()
    {
        try
        {
            return(GetItemList());
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
            return(null);
        }
    }
Пример #16
0
    public static FighterAttributes GetPlayerAttributesFromModel()
    {
        try
        {
            return(GetFighterAttributes());
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
            return(null);
        }
    }
Пример #17
0
    public static string Start(FighterAttributes attributes)
    {
        try
        {
            return(GetExamineMessage(attributes));
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return("Error in generating message.");
        }
    }
    public static string Start(string name)
    {
        try
        {
            return(RemoveTag(name));
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(name);
        }
    }
Пример #19
0
    public static int Start()
    {
        try
        {
            return(GetBonusHP());
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(0);
        }
    }
Пример #20
0
    public static int Start(int maxSpawns)
    {
        try
        {
            return(GetSpawns(maxSpawns));
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(maxSpawns);
        }
    }
    public static FighterAttributes Start()
    {
        try
        {
            return(CreateAttributes());
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(new FighterAttributes());
        }
    }
    public static Rect Start(Rect rectGUI)
    {
        try
        {
            return(SetRect(rectGUI));
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(rectGUI);
        }
    }
Пример #23
0
    private void SaveAggregate()
    {
        /////////////////////////////////////////////////////
        //Local Variables

        BinaryFormatter formatter = new BinaryFormatter();

        FileStream file;

        string filePath = "";

        /////////////////////////////////////////////////////

        filePath = GetFilePath();

        file = File.Create(filePath);

        formatter.Serialize(file, this.Aggregate);

        StaticTrace.Log(String.Format("File saved at '{0}'.", filePath));

        file.Close();
    }