public override void OnInspectorGUI()
    {
        serializedObject.Update();

        CombatGrid grid = (target as CombatGrid);

        if (grid.myTerrainGridData != null)
        {
            grid.myTerrainGridData.SetGridChangeListener(delegate()
            {
                Debug.Log("Combat Grid got updated from ScriptableObject!");
                grid.UpdateGridRepresentation();
            });
        }

        EditorGUI.BeginChangeCheck();
        EditorGUILayout.PropertyField(myTerrainSpriteLibraryProperty);
        EditorGUILayout.PropertyField(myTerrainGridDataProperty);
        bool wasChanged = EditorGUI.EndChangeCheck();

        EditorGUILayout.PropertyField(myCellTemplateProperty);

        serializedObject.ApplyModifiedProperties();

        if (wasChanged || GUILayout.Button("Rebuild cells preview"))
        {
            grid.UpdateGridRepresentation();
        }
    }
示例#2
0
文件: AI.cs 项目: thomasbrooks4/Raid
    // Start is called before the first frame update
    public virtual void Start()
    {
        activeCharacter = GetComponent <Character>();
        allEnemies      = GetEnemies();

        combatManagerObject = GameObject.FindGameObjectWithTag("Combat Manager");
        combatManager       = combatManagerObject.GetComponent <CombatManager>();
        combatGrid          = combatManagerObject.GetComponent <CombatGrid>();
    }
示例#3
0
    void Start()
    {
        CombatGrid = GetComponent <CombatGrid>();
        GameManager.Instance.PlayerSave = SaveManager.LoadSave();

        SetupPhase = true;
        IsPaused   = false;

        CombatGrid.Initialize();
    }
示例#4
0
 void Start()
 {
     grid = GameObject.FindGameObjectWithTag("Combat Manager").GetComponent <CombatGrid>();
 }
示例#5
0
文件: World.cs 项目: Blecki/CCDC
 public void PrepareCombatGrid()
 {
     CombatGrid = CombatGrid.CreateFromCellGrid(Grid);
     CombatGrid.Cells.forAll((c, x, y, z) => { if (c != null) c.Texture = 0; });
 }
示例#6
0
 public CombatGridVisual(CombatGrid Grid, Euler Euler = null)
 {
     this.Grid = Grid;
     this.Orientation = Euler;
     if (this.Orientation == null) this.Orientation = new Euler();
 }