示例#1
0
    // Start is called before the first frame update
    public void initialize()
    {
        gridMaster = (Grid)GameObject.Find("GameMaster").GetComponent(typeof(Grid));
        selector   = (selector)GameObject.Find("Selector").GetComponent(typeof(selector));


        thisNode          = gridMaster.nodeFromWorldPoint(this.transform.position);
        thisNode.walkable = false;
        thisNode.tiletype = "HQ";

        creationRange = new List <Node>();
        if (thisNode.upNode != null)
        {
            creationRange.Add(thisNode.upNode);
        }
        if (thisNode.rightNode != null)
        {
            creationRange.Add(thisNode.rightNode);
        }
        if (thisNode.downNode != null)
        {
            creationRange.Add(thisNode.downNode);
        }
        if (thisNode.leftNode != null)
        {
            creationRange.Add(thisNode.leftNode);
        }
    }
示例#2
0
 public void initialize()
 {
     //gridMaster = (Grid)GameObject.Find("GameMaster").GetComponent(typeof(Grid));
     cursorParent = gridMaster.selector;
     unitHQ_code  = gridMaster.selector.unitHQ_code;
     menubuygas   = gridMaster.selector.menuBuyGas;
     //menubuygas.gameObject.SetActive(false);
 }
示例#3
0
 void Start()
 {
     sel           = GetComponent <selector> ();
     cre           = GetComponent <Creator> ();
     placedMarkers = new List <GameObject> ();
     paths         = new List <List <GameObject> > ();
     allowedPaths  = new List <GameObject> ();
     possibilities = new bool[8, 8];
 }
示例#4
0
    public void initialize()
    {
        gridMaster     = (Grid)GameObject.Find("GameMaster").GetComponent(typeof(Grid));
        cursorParent   = (selector)GameObject.Find("Selector").GetComponent(typeof(selector));
        content        = this.transform.Find("Viewport/Content").gameObject;
        selectedOption = 0;
        maxOptions     = 0;
        buttonArray    = new List <GameObject>();

        makeOptions();
    }
示例#5
0
        static void ExtractFromArray <T>(ref T[] arr, selector <T> sel)
        {
            T [] newArr  = new T[arr.Length];
            int  counter = 0;

            for (int i = 0; i < arr.Length; i++)
            {
                if (sel(arr[i]))
                {
                    newArr[counter] = arr[i];
                    counter++;
                }
            }
            Array.Resize(ref newArr, counter);
            arr = newArr;
        }
示例#6
0
    public void initialize()
    {
        //plane = this.transform.Find("Quad").transform;

        //mc movement
        if (selector == null)
        {
            selector = (selector)GameObject.Find("Selector").GetComponent(typeof(selector));
        }
        if (guimanager == null)
        {
            guimanager = (GUImanager)GameObject.Find("GUImanager").GetComponent(typeof(GUImanager));
        }


        if (stageResult == null)
        {
            stageResult = (menuStageResult)GameObject.Find("stageResult").GetComponent(typeof(menuStageResult));
        }
        stageResult.gridMaster = this;
        stageResult.initialize();
        stageResult.gameObject.SetActive(false);

        if (menuTutorial == null)
        {
            menuTutorial = (tutorialScreen)GameObject.Find("tutorialScreen").GetComponent(typeof(tutorialScreen));
        }
        menuTutorial.initialize();
        menuTutorial.gameObject.SetActive(false);

        minesprites2 = Resources.LoadAll <Sprite>("mine_sprites2");

        readFile();
        updateActors();

        playersturn           = true;
        turnCount             = 1;
        selector.actionLocked = false;
        selector.initialize();
        showTutorial();
    }
示例#7
0
    // Start is called before the first frame update
    void Start()
    {
        gridMaster = (Grid)GameObject.Find("GameMaster").GetComponent(typeof(Grid));
        selector   = (selector)GameObject.Find("Selector").GetComponent(typeof(selector));

        headAnimator = this.transform.Find("worm_head").gameObject.GetComponent <Animator>();
        bodyAnimator = this.transform.Find("worm_body").gameObject.GetComponent <Animator>();
        childSprites = GetComponentsInChildren <SpriteRenderer>();
        foreach (SpriteRenderer csprite in childSprites)
        {
            csprite.enabled = false;
        }

        enemyDone = true;
        thisNode  = gridMaster.nodeFromWorldPoint(this.transform.position);
        lastNode  = thisNode;
        heldRelic = null;

        enemyClass = globals.wormname;
        maxHealth  = globals.wormhealth;
        health     = globals.wormhealth;
        UnitPower  = globals.wormPower;
    }
示例#8
0
    // Start is called before the first frame update
    void Start()
    {
        gridMaster = (Grid)GameObject.Find("GameMaster").GetComponent(typeof(Grid));
        selector   = (selector)GameObject.Find("Selector").GetComponent(typeof(selector));

        //spriteAnimator = this.gameObject.GetComponentsInChildren<Animator>(); //0=drill 1=threads

        attackAnimator   = this.transform.Find("sprite_drill").gameObject.GetComponent <Animator>();
        movementAnimator = this.transform.Find("sprite_threads").gameObject.GetComponent <Animator>();
        childSprites     = GetComponentsInChildren <SpriteRenderer>();

        thisNode  = gridMaster.nodeFromWorldPoint(this.transform.position);
        lastNode  = thisNode;
        heldRelic = null;

        maxWalkDistance = 3;
        unitClass       = globals.drillname;
        health          = globals.drillhealth;
        maxHealth       = globals.drillhealth;
        attackPower     = globals.drillattackstat;
        basecost        = globals.action_cost_base_drill;
        attackRange     = 1;
        scanRange       = globals.scout_scan_range;
    }
示例#9
0
 // Use this for initialization
 void Start()
 {
     masterSelector = GetComponent <selector>();
 }
 With(selector, value);
示例#11
0
        /// <summary>
        /// 查询对象集合
        /// </summary>
        /// <typeparam name="valueType">对象类型</typeparam>
        /// <typeparam name="modelType">模型类型</typeparam>
        /// <param name="sqlTool">SQL操作工具</param>
        /// <param name="query">查询信息</param>
        /// <param name="memberMap">成员位图</param>
        /// <param name="onGet"></param>
        public override void Select <valueType, modelType>
            (fastCSharp.emit.sqlTable.sqlTool <valueType, modelType> sqlTool, selectQuery <modelType> query, fastCSharp.code.memberMap <modelType> memberMap, Action <subArray <valueType> > onGet)
        {
            if (onGet == null)
            {
                log.Error.Throw(log.exceptionType.Null);
            }
            subArray <valueType> values = default(subArray <valueType>);

            try
            {
                selector <valueType, modelType> selector = selector <valueType, modelType> .Get();

                if (selector != null)
                {
                    selector.MemberMap.CopyFrom(fastCSharp.emit.sqlModel <modelType> .MemberMap);
                    if (memberMap != null && !memberMap.IsDefault)
                    {
                        selector.MemberMap.And(memberMap);
                    }
                    if (query != null && query.SkipCount != 0 && query.Orders.length() != 0)
                    {
                        if (sqlModel <modelType> .PrimaryKeys.Length == 1)
                        {
                            string sql = selectKeys(sqlTool, query, sqlModel <modelType> .PrimaryKeys[0].SqlFieldName, selector.MemberMap, selector.SqlStream);
                            if (sql != null)
                            {
                                selector.Get(this, sql, 0, ref onGet);
                                return;
                            }
                            values.array = nullValue <valueType> .Array;
                        }
                        else if (sqlModel <modelType> .Identity != null)
                        {
                            string sql = selectKeys(sqlTool, query, sqlModel <modelType> .Identity.SqlFieldName, selector.MemberMap, selector.SqlStream);
                            if (sql != null)
                            {
                                selector.Get(this, sql, 0, ref onGet);
                                return;
                            }
                            values.array = nullValue <valueType> .Array;
                        }
                        else
                        {
                            string sql = selectRows(sqlTool, query, selector.MemberMap, selector.SqlStream);
                            if (sql != null)
                            {
                                selector.Get(this, sql, 0, ref onGet);
                                return;
                            }
                            values.array = nullValue <valueType> .Array;
                        }
                    }
                    if (values.array == null)
                    {
                        string sql = selectNoOrder(sqlTool, query, selector.MemberMap, selector.SqlStream);
                        if (sql != null)
                        {
                            selector.Get(this, sql, query == null ? 0 : query.SkipCount, ref onGet);
                            return;
                        }
                        values.array = nullValue <valueType> .Array;
                    }
                    typePool <selector <valueType, modelType> > .PushNotNull(selector);
                }
            }
            finally
            {
                if (onGet != null)
                {
                    onGet(values);
                }
            }
        }
 return(await option.SelectAsync <TResult, TSelector>(selector, cancellationToken).ConfigureAwait(false));
示例#13
0
 var ruleKey     = GetKey(selector, key);
        private static Dictionary <string, FileInfoWrapper> FindBy(selector s, Dictionary <string, FileInfoWrapper> source)
        {
            var result = source.Where(p => s(p)).ToDictionary(k => k.Key, k => k.Value);

            return(result);
        }
示例#15
0
    // public variable that can be set to LTouch or RTouch in the Unity Inspector
    //public Controller controller;

    // Use this for initialization
    void Start()
    {
        SetBPM(initialBPM);
        _selectorScript = selector.GetComponent <selector>();
        timer           = 0;
    }
 foreach (var(selector, value) in setters)
示例#17
0
 public void initialize()
 {
     //if (gridMaster == null) { gridMaster = (Grid)GameObject.Find("GameMaster").GetComponent(typeof(Grid)); }
     cursorParent = gridMaster.selector;
 }
示例#18
0
 public selectQuery(string _rowsVariable, GroupCollection attribCollection)
 {
     string[] holdCollection = attribCollection.Cast<Group>().Skip(1).Select(n => n.Value.Trim()).ToArray();
     this.rowsVariable = _rowsVariable;
     this.isNumeric = holdCollection[0] == "LENGTH";
     this.isPositive = holdCollection[1] == "IS";
     this.usedOperator = baseDefinitions.operatorConversion[holdCollection[1]];
     this.queryRange = holdCollection[2] == "ANY" ? selector.Any : holdCollection[2] == "EVERY" ? selector.Every : selector.None;
     this.comparedTo = codeParsing.serializeNumericString(holdCollection[3]);
 }
示例#19
0
    public int state; // 0=hidden, 1=revealed, 2=taken, 3=saved

    // Start is called before the first frame update
    void Start()
    {
        gridMaster = (Grid)GameObject.Find("GameMaster").GetComponent(typeof(Grid));
        selector   = (selector)GameObject.Find("Selector").GetComponent(typeof(selector));
        thisNode   = gridMaster.nodeFromWorldPoint(this.transform.position);
    }