Наследование: MonoBehaviour
Пример #1
0
    public void SetTarget(Transform atk, Transform sel, bool fightBack, bool critiq)
    {
        attacker = atk;
        ignoreList = new List<Transform>();
        rc = Camera.mainCamera.GetComponent<RoundCounter>();
        if(sel!=null){
            target = sel;
            foreach(Transform x in rc.AllChesses){
                if(x != target){
                    ignoreList.Add(x);
                }
            }
        }else{
            if(attacker.GetComponent<CharacterProperty>().Player == 1){
                ignoreList = rc.PlayerAChesses;
            }else if(attacker.GetComponent<CharacterProperty>().Player == 2){
                ignoreList = rc.PlayerBChesses;
            }
        }
        fightBackMode = fightBack;
        critiqHit = critiq;
        excuted = false;

        foreach(Transform chess in ignoreList){
            Physics.IgnoreCollision(transform.collider, chess.collider);
        }
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     currentSelect              = this.GetComponent <selection>();
     segment                    = btSize;
     posMoveBt                  = new Rect(leftMargin, topMargin, btSize, btSize);
     posSummonBt                = new Rect(leftMargin, topMargin + segment, btSize, btSize);
     posAttackBt                = new Rect(leftMargin, topMargin + segment * 2, btSize, btSize);
     posSkillBt                 = new Rect(leftMargin, topMargin + segment * 3, btSize, btSize);
     posDefenseBt               = new Rect(leftMargin, topMargin + segment * 4, btSize, btSize);
     posEndTurnBt               = new Rect(leftMargin, topMargin + segment * 5, btSize, btSize);
     MainGuiShow                = false;
     mousePos                   = new Vector2();
     mainStyle.font             = MainFont;
     mainStyle.normal.textColor = Color.white;
     mainStyle.fontSize         = 20;
     subStyle                   = new GUIStyle(mainStyle);
     subStyle.fontSize          = 16;
     subStyle.normal.textColor  = new Color(.8f, .8f, .8f, 1.0f);
     subStyle.onHover.textColor = Color.white;
     players                    = this.GetComponent <RoundCounter>();
     numIcon                    = this.GetComponent <NumIconVault>();
     infoUI        = this.GetComponent <InfoUI>();
     chessUI       = this.GetComponent <MainInfoUI>();
     InSecondTutor = false;
     init          = GameObject.Find("InitStage").transform.GetComponent <InitStage>();
 }
Пример #3
0
 private void Start()
 {
     animator           = GetComponent <Animator>();
     capsuleCollider    = GetComponent <CapsuleCollider>();
     navMeshAgent       = GetComponent <NavMeshAgent>();
     score              = GameObject.Find("Puntuacion").GetComponent <Score>();
     roundCounter       = GameObject.Find("RoundCounter");
     roundCounterScript = roundCounter.GetComponent <RoundCounter>();
 }
Пример #4
0
    public Transform GetClosetChess(Transform chess)
    {
        Transform    target  = null;
        IList        targets = new List <Transform>();
        RoundCounter rc      = transform.GetComponent <RoundCounter>();

        if (chess.GetComponent <CharacterProperty>().Player == 1)
        {
            foreach (Transform t in rc.PlayerBChesses)
            {
                if (!t.GetComponent <CharacterProperty>().death)
                {
                    targets.Add(t);
                }
            }
        }
        else
        {
            foreach (Transform t in rc.PlayerAChesses)
            {
                if (!t.GetComponent <CharacterProperty>().death)
                {
                    targets.Add(t);
                }
            }
        }
        Dictionary <float, Transform> sortDict = new Dictionary <float, Transform>();

        if (targets.Count > 0)
        {
            foreach (Transform t in targets)
            {
                float dis = Vector3.Distance(chess.transform.position, t.transform.position);
                if (!sortDict.ContainsKey(dis))
                {
                    sortDict.Add(dis, t);
                }
            }
            var list = sortDict.Keys.ToList();
            list.Sort();
            target = sortDict[list[0]];
        }
        else
        {
            if (chess.GetComponent <CharacterProperty>().Player == 1)
            {
                target = GameObject.Find("yellow-tower").transform;
            }
            else
            {
                target = GameObject.Find("red-tower").transform;
            }
        }

        return(target);
    }
Пример #5
0
        void CalBuffUsage()
        {
            BuffUsage    bUsage       = BuffUsage.None;
            int          locationSide = 0;
            Transform    location     = selection.getMapPosition();
            RoundCounter rnd          = Camera.mainCamera.GetComponent <RoundCounter>();

            if (rnd.PlayerATerritory.Contains(location))
            {
                locationSide = 1;
            }
            else if (rnd.PlayerBTerritory.Contains(location))
            {
                locationSide = 2;
            }
            else
            {
                locationSide = 0;
            }

            if (playerSide == 1)
            {
                switch (locationSide)
                {
                case (1):
                    bUsage = BuffUsage.Intensify;
                    break;

                case (2):
                    bUsage = BuffUsage.Decrease;
                    break;

                case (0):
                    bUsage = BuffUsage.None;
                    break;
                }
            }
            else if (playerSide == 2)
            {
                switch (locationSide)
                {
                case (1):
                    bUsage = BuffUsage.Decrease;
                    break;

                case (2):
                    bUsage = BuffUsage.Intensify;
                    break;

                case (0):
                    bUsage = BuffUsage.None;
                    break;
                }
            }
            usage = bUsage;
        }
Пример #6
0
    private void Awake()
    {
        inst   = this;
        myText = GetComponent <TextMeshProUGUI>();

        if (GameManager.instance)
        {
            setRound(GameManager.instance.round);
        }
    }
Пример #7
0
    private void Start()
    {
        _gridController = FindObjectOfType <GridController>();
        _timer          = FindObjectOfType <Timer>();
        _roundCounter   = FindObjectOfType <RoundCounter>();
        _currentRound   = _roundCounter.GetRound();
        _sceneLoader    = FindObjectOfType <SceneLoader>();

        _roundGoal = firstRoundGoal + additionPerRound * (_currentRound - 1);
    }
Пример #8
0
 // Use this for initialization
 void Awake()
 {
     UIItems                        = new List <UnNormalUI>();
     smallFloating                  = new GUIStyle();
     smallFloating.alignment        = TextAnchor.MiddleCenter;
     smallFloating.normal.textColor = Color.grey;
     smallFloating.font             = UIFont;
     smallFloating.fontSize         = 18;
     rc = transform.GetComponent <RoundCounter>();
 }
 // Use this for initialization
 void Awake()
 {
     UIItems = new List<UnNormalUI>();
     smallFloating = new GUIStyle();
     smallFloating.alignment = TextAnchor.MiddleCenter;
     smallFloating.normal.textColor = Color.grey;
     smallFloating.font = UIFont;
     smallFloating.fontSize = 18;
     rc = transform.GetComponent<RoundCounter>();
 }
Пример #10
0
 // Use this for initialization
 void Start()
 {
     InMove          = false;
     InPause         = false;
     decisions       = transform.GetComponent <Decisions>();
     CurrentSel      = Camera.main.GetComponent <selection>();
     CurrentRC       = Camera.main.GetComponent <RoundCounter>();
     playerBList     = new List <Transform>();
     firstPhaseList  = new List <Transform>();
     secondPhaseList = new List <Transform>();
     thirdPhaseList  = new List <Transform>();
 }
Пример #11
0
 // Start is called before the first frame update
 void Awake()
 {
     Debug.Log("Round" + round);
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
     DontDestroyOnLoad(this.gameObject);
 }
Пример #12
0
    // Use this for initialization
    void Start()
    {
        aider        = transform.parent.parent;
        chessStorage = Camera.main.GetComponent <RoundCounter>();
        CommonFX cFX = Camera.main.GetComponent <CommonFX>();

        fxBuffAtk    = cFX.BuffAtk;
        fxBuffCritiq = cFX.BuffCritiq;
        fxBuffDef    = cFX.BuffDef;
        fxBuffMove   = cFX.BuffMove;
        fxBuffRange  = cFX.BuffRange;
        fxBuffSkill  = cFX.BuffSkill;
    }
Пример #13
0
    void Die()
    {
        roundCounterScript = roundCounter.GetComponent <RoundCounter>();
        score.DieScore();
        dead = true;
        animator.SetBool("Dead", dead);
        Rigidbody rb = this.gameObject.GetComponent <Rigidbody>();

        rb.constraints = RigidbodyConstraints.FreezePosition;

        roundCounterScript.KillCount();
        navMeshAgent.enabled    = false;
        capsuleCollider.enabled = false;
        //Destroy(gameObject);
    }
Пример #14
0
    // Use this for initialization
    void Start()
    {
        territoryStart = new Rect(Screen.width - 350.0f, 6.0f, 28.0f, 28.0f);
        allMaps        = GameObject.Find("Maps").transform.childCount;
        iconVault      = transform.GetComponent <InfoUI>();
        rc             = transform.GetComponent <RoundCounter>();
        mainInfoUI     = transform.GetComponent <MainInfoUI>();

        numberStyle[0]                  = new GUIStyle();
        numberStyle[1]                  = new GUIStyle();
        numberStyle[0].font             = Number;
        numberStyle[1].font             = Number;
        numberStyle[0].normal.textColor = new Color(0.8f, 0.8f, 0.8f, 1.0f);
        numberStyle[1].normal.textColor = new Color(0.8f, 0.8f, 0.8f, 1.0f);
        numberStyle[0].fontSize         = 24;
        numberStyle[1].fontSize         = 20;
    }
Пример #15
0
    // Use this for initialization
    void Start()
    {
        territoryStart = new Rect(Screen.width-350.0f, 6.0f, 28.0f, 28.0f);
        allMaps = GameObject.Find("Maps").transform.childCount;
        iconVault = transform.GetComponent<InfoUI>();
        rc = transform.GetComponent<RoundCounter>();
        mainInfoUI = transform.GetComponent<MainInfoUI>();

        numberStyle[0] = new GUIStyle();
        numberStyle[1] = new GUIStyle();
        numberStyle[0].font = Number;
        numberStyle[1].font = Number;
        numberStyle[0].normal.textColor = new Color(0.8f,0.8f,0.8f,1.0f);
        numberStyle[1].normal.textColor = new Color(0.8f,0.8f,0.8f,1.0f);
        numberStyle[0].fontSize = 24;
        numberStyle[1].fontSize = 20;
    }
Пример #16
0
 // Use this for initialization
 void Start()
 {
     leftChess                       = null;
     rightChess                      = null;
     leftInfoWin                     = new Rect(0, Screen.height - 170, 500, 154);
     rightInfoWin                    = new Rect(Screen.width - leftInfoWin.width, leftInfoWin.y, 500, 154);
     leftChessPos                    = new Rect(0, Screen.height - 310, 250, 250);
     rightChessPos                   = new Rect(Screen.width - leftChessPos.width, leftChessPos.y, 250, 250);
     mirrorRect                      = new Rect(0, 0, -1, 1);
     posLeftTitle                    = new Rect(250.0f, Screen.height - leftInfoWin.height - 15, 250, 30);
     posRightTitle                   = new Rect(Screen.width - rightInfoWin.width + 30, posLeftTitle.y, posLeftTitle.width, posLeftTitle.height);
     posLeftContent                  = new Rect(posLeftTitle.x, posLeftTitle.y + 45, iconWidth, iconWidth);
     posRightContent                 = new Rect(Screen.width - rightInfoWin.width + 30, posLeftContent.y, iconWidth, iconWidth);
     posAChessList                   = new Rect(105, Screen.height - 55, 40, 40);
     posBChessList                   = new Rect(Screen.width - 155, Screen.height - 55, 40, 40);
     titleStyle                      = new GUIStyle();
     titleStyle.font                 = Title;
     titleStyle.fontSize             = 28;
     titleStyle.normal.textColor     = Color.white;
     manaStyle                       = new GUIStyle();
     manaStyle.font                  = Number;
     manaStyle.fontSize              = 36;
     manaStyle.normal.textColor      = new Color(1.0f, 1.0f, 1.0f, 0.5f);
     numberStyle[0]                  = new GUIStyle();
     numberStyle[1]                  = new GUIStyle();
     numberStyle[2]                  = new GUIStyle();
     numberStyle[0].font             = Number;
     numberStyle[1].font             = Number;
     numberStyle[2].font             = Number;
     numberStyle[0].normal.textColor = new Color(0.5f, 0.5f, 0.5f, 1.0f);
     numberStyle[1].normal.textColor = new Color(0.5f, 0.5f, 0.5f, 1.0f);
     numberStyle[2].normal.textColor = new Color(0.5f, 0.5f, 0.5f, 1.0f);
     numberStyle[0].fontSize         = 24;
     numberStyle[1].fontSize         = 30;
     numberStyle[2].fontSize         = 44;
     iconVault                       = transform.GetComponent <InfoUI>();
     rc                          = transform.GetComponent <RoundCounter>();
     roundStyle                  = new GUIStyle(manaStyle);
     roundStyle.fontSize         = 48;
     roundStyle.alignment        = TextAnchor.MiddleCenter;
     roundStyle.normal.textColor = new Color(1.0f, 1.0f, 1.0f, 0.8f);
 }
Пример #17
0
    public void SetTarget(Transform atk, Transform sel, bool fightBack, bool critiq)
    {
        attacker   = atk;
        ignoreList = new List <Transform>();
        rc         = Camera.mainCamera.GetComponent <RoundCounter>();
        if (sel != null)
        {
            target = sel;
            foreach (Transform x in rc.AllChesses)
            {
                if (x != target)
                {
                    ignoreList.Add(x);
                }
            }
        }
        else
        {
            if (attacker.GetComponent <CharacterProperty>().Player == 1)
            {
                ignoreList = rc.PlayerAChesses;
            }
            else if (attacker.GetComponent <CharacterProperty>().Player == 2)
            {
                ignoreList = rc.PlayerBChesses;
            }
        }
        fightBackMode = fightBack;
        critiqHit     = critiq;
        excuted       = false;

        foreach (Transform chess in ignoreList)
        {
            Physics.IgnoreCollision(transform.collider, chess.collider);
        }
    }
Пример #18
0
        int GetBuffValue(BuffType type)
        {
            int          buffValue  = 0;
            RoundCounter rnd        = Camera.mainCamera.GetComponent <RoundCounter>();
            Transform    allMap     = GameObject.Find("Maps").transform;
            int          mapUnitNum = allMap.childCount;
            int          rate       = 0;

            if (playerSide == 1)
            {
                rate = Mathf.RoundToInt((float)rnd.PlayerATerritory.Count / (float)mapUnitNum * 100.0f);
            }
            else if (playerSide == 2)
            {
                rate = Mathf.RoundToInt((float)rnd.PlayerBTerritory.Count / (float)mapUnitNum * 100.0f);
            }

            switch (type)
            {
            case BuffType.Attack:
                buffValue = BuffXValue(rate);
                break;

            case BuffType.Defense:
                buffValue = BuffXValue(rate);
                break;

            case BuffType.AttackRange:
                buffValue = BuffXValue(rate);
                break;

            case BuffType.MoveRange:
                buffValue = BuffXValue(rate);
                break;

            case BuffType.CriticalHit:
                buffValue = BuffRateValue(rate);
                break;

            case BuffType.SkillRate:
                buffValue = BuffRateValue(rate);
                break;
            }


            if (usage == BuffUsage.Intensify)
            {
                buffValue = buffValue;
            }
            else if (usage == BuffUsage.None)
            {
                buffValue = 0;
            }
            else if (usage == BuffUsage.Decrease)
            {
                buffValue = -buffValue;
            }

            /*
             * switch(type){
             *      case(BuffType.Attack):
             *              if(playerSide==1){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = ((float)rnd.PlayerATerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.atkPower,0.1f);
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -((float)rnd.PlayerATerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.atkPower,0.1f);
             *                      else
             *                              buffValue = 0.0f;
             *              }else if(playerSide==2){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = ((float)rnd.PlayerBTerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.atkPower,0.1f);
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -((float)rnd.PlayerBTerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.atkPower,0.1f);
             *                      else
             *                              buffValue = 0.0f;
             *              }
             *              break;
             *      case(BuffType.AttackRange):
             *              if(playerSide==1){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = ((float)rnd.PlayerATerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.atkRange,0.1f);
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -((float)rnd.PlayerATerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.atkRange,0.1f);
             *                      else
             *                              buffValue = 0.0f;
             *              }else if(playerSide==2){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = ((float)rnd.PlayerBTerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.atkRange,0.1f);
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -((float)rnd.PlayerBTerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.atkRange,0.1f);
             *                      else
             *                              buffValue = 0.0f;
             *              }
             *              break;
             *      case(BuffType.CriticalHit):
             *              if(playerSide==1){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = Mathf.Pow((float)rnd.PlayerATerritory.Count/mapUnitNum*10.0f,0.2f)*(float)property.CriticalhitChance;
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -Mathf.Pow((float)rnd.PlayerATerritory.Count/mapUnitNum*10.0f,0.2f)*(float)property.CriticalhitChance;
             *                      else
             *                              buffValue = 0.0f;
             *              }else if(playerSide==2){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = Mathf.Pow((float)rnd.PlayerBTerritory.Count/mapUnitNum*10.0f,0.2f)*(float)property.CriticalhitChance;
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -Mathf.Pow((float)rnd.PlayerBTerritory.Count/mapUnitNum*10.0f,0.2f)*(float)property.CriticalhitChance;
             *                      else
             *                              buffValue = 0.0f;
             *              }
             *              break;
             *      case(BuffType.Defense):
             *              if(playerSide==1){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = ((float)rnd.PlayerATerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.defPower,0.1f);
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -((float)rnd.PlayerATerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.defPower,0.1f);
             *                      else
             *                              buffValue = 0.0f;
             *              }else if(playerSide==2){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = ((float)rnd.PlayerBTerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.defPower,0.1f);
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -((float)rnd.PlayerBTerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.defPower,0.1f);
             *                      else
             *                              buffValue = 0.0f;
             *              }
             *              break;
             *      case(BuffType.MoveRange):
             *              if(playerSide==1){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = ((float)rnd.PlayerATerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.moveRange,0.1f);
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -((float)rnd.PlayerATerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.moveRange,0.1f);
             *                      else
             *                              buffValue = 0.0f;
             *              }else if(playerSide==2){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = ((float)rnd.PlayerBTerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.moveRange,0.1f);
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -((float)rnd.PlayerBTerritory.Count/mapUnitNum)*2*Mathf.Pow((float)property.moveRange,0.1f);
             *                      else
             *                              buffValue = 0.0f;
             *              }
             *              break;
             *      case(BuffType.SkillRate):
             *              if(playerSide==1){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = Mathf.Pow((float)rnd.PlayerATerritory.Count/mapUnitNum*10.0f,0.2f)*(float)property.SkillRate;
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -Mathf.Pow((float)rnd.PlayerATerritory.Count/mapUnitNum*10.0f,0.2f)*(float)property.SkillRate;
             *                      else
             *                              buffValue = 0.0f;
             *              }else if(playerSide==2){
             *                      if(usage == BuffUsage.Intensify)
             *                              buffValue = Mathf.Pow((float)rnd.PlayerATerritory.Count/mapUnitNum*10.0f,0.2f)*(float)property.SkillRate;
             *                      else if(usage == BuffUsage.Decrease)
             *                              buffValue = -Mathf.Pow((float)rnd.PlayerATerritory.Count/mapUnitNum*10.0f,0.2f)*(float)property.SkillRate;
             *                      else
             *                              buffValue = 0.0f;
             *              }
             *              break;
             * }
             */
            return(buffValue);
        }
Пример #19
0
 // Use this for initialization
 void Start()
 {
     leftChess = null;
     rightChess = null;
     leftInfoWin = new Rect(0,Screen.height-170,500,154);
     rightInfoWin = new Rect(Screen.width-leftInfoWin.width, leftInfoWin.y,500,154);
     leftChessPos = new Rect(0,Screen.height-310, 250,250);
     rightChessPos = new Rect(Screen.width-leftChessPos.width, leftChessPos.y,250,250);
     mirrorRect = new Rect(0,0,-1,1);
     posLeftTitle = new Rect(250.0f,Screen.height-leftInfoWin.height-15,250,30);
     posRightTitle = new Rect(Screen.width - rightInfoWin.width+30, posLeftTitle.y,posLeftTitle.width,posLeftTitle.height);
     posLeftContent = new Rect(posLeftTitle.x, posLeftTitle.y+45,iconWidth,iconWidth);
     posRightContent = new Rect(Screen.width - rightInfoWin.width+30,posLeftContent.y,iconWidth,iconWidth);
     posAChessList = new Rect(105,Screen.height-55,40,40);
     posBChessList = new Rect(Screen.width-155,Screen.height-55,40,40);
     titleStyle = new GUIStyle();
     titleStyle.font = Title;
     titleStyle.fontSize = 28;
     titleStyle.normal.textColor = Color.white;
     manaStyle = new GUIStyle();
     manaStyle.font = Number;
     manaStyle.fontSize = 36;
     manaStyle.normal.textColor = new Color(1.0f,1.0f,1.0f,0.5f);
     numberStyle[0] = new GUIStyle();
     numberStyle[1] = new GUIStyle();
     numberStyle[2] = new GUIStyle();
     numberStyle[0].font = Number;
     numberStyle[1].font = Number;
     numberStyle[2].font = Number;
     numberStyle[0].normal.textColor = new Color(0.5f,0.5f,0.5f,1.0f);
     numberStyle[1].normal.textColor = new Color(0.5f,0.5f,0.5f,1.0f);
     numberStyle[2].normal.textColor = new Color(0.5f,0.5f,0.5f,1.0f);
     numberStyle[0].fontSize = 24;
     numberStyle[1].fontSize = 30;
     numberStyle[2].fontSize = 44;
     iconVault = transform.GetComponent<InfoUI>();
     rc = transform.GetComponent<RoundCounter>();
     roundStyle = new GUIStyle(manaStyle);
     roundStyle.fontSize = 48;
     roundStyle.alignment = TextAnchor.MiddleCenter;
     roundStyle.normal.textColor = new Color(1.0f,1.0f,1.0f,0.8f);
 }
Пример #20
0
 // Use this for initialization
 void Start()
 {
     aider        = transform.parent.parent;
     chessStorage = Camera.main.GetComponent <RoundCounter>();
 }
Пример #21
0
 // Use this for initialization
 void Start()
 {
     rc = Camera.mainCamera.GetComponent<RoundCounter>();
 }
Пример #22
0
 // Use this for initialization
 void Start()
 {
     chessStorage = Camera.main.GetComponent<RoundCounter>();
 }
Пример #23
0
 // Use this for initialization
 void Start()
 {
     mapStorage = Camera.main.GetComponent <RoundCounter>();
 }
Пример #24
0
    void Start()
    {
        charactersavehealth = GameObject.Find("CharacterHealthsaver");
        healthscript        = charactersavehealth.GetComponent <CharacterSavedHealth>();

        unit      = GameObject.Find("Round Counter");
        uscript   = unit.GetComponent <RoundCounter>();
        roundswon = uscript.rounds;


        loadClasses();

        storage     = GameObject.Find("SelectionStorage");
        charstorage = storage.GetComponent <CharacterSelectStorage>();

        dead       = false;
        selected   = false;
        maxHealth  = Classes[ClassInt].healthMax;
        health     = Classes[ClassInt].healthMax;
        armor      = Classes[ClassInt].armor;
        minD       = Classes[ClassInt].minDamage;
        maxD       = Classes[ClassInt].maxDamage;
        critChance = Classes[ClassInt].crit;
        speed      = Random.Range(0, 4);
        if (Ally)
        {
            GameObject.Find(this.name + "Canvas").transform.SetPositionAndRotation(new Vector3(83, 1000, 0), Quaternion.identity);
        }

        for (int i = 1; i < 5; i++)
        {
            if (this.name == "Ally#" + i)
            {
                positionInt = i;
                this.tag    = "Ally" + i;
            }
            else if (this.name == "Enemy#" + i)
            {
                positionInt = i;
                this.tag    = "Enemy" + i;
            }
        }

        if (this.tag == "Ally1")
        {
            if (charstorage.StorageList[0] == 1)
            {
                ClassInt = 0;
            }
            if (charstorage.StorageList[0] == 2)
            {
                ClassInt = 1;
            }
            if (charstorage.StorageList[0] == 3)
            {
                ClassInt = 2;
            }
            if (charstorage.StorageList[0] == 4)
            {
                ClassInt = 3;
            }
        }

        if (this.tag == "Ally2")
        {
            if (charstorage.StorageList[1] == 1)
            {
                ClassInt = 0;
            }
            if (charstorage.StorageList[1] == 2)
            {
                ClassInt = 1;
            }
            if (charstorage.StorageList[1] == 3)
            {
                ClassInt = 2;
            }
            if (charstorage.StorageList[1] == 4)
            {
                ClassInt = 3;
            }
        }

        if (this.tag == "Ally3")
        {
            if (charstorage.StorageList[2] == 1)
            {
                ClassInt = 0;
            }
            if (charstorage.StorageList[2] == 2)
            {
                ClassInt = 1;
            }
            if (charstorage.StorageList[2] == 3)
            {
                ClassInt = 2;
            }
            if (charstorage.StorageList[2] == 4)
            {
                ClassInt = 3;
            }
        }

        if (this.tag == "Ally4")
        {
            if (charstorage.StorageList[3] == 1)
            {
                ClassInt = 0;
            }
            if (charstorage.StorageList[3] == 2)
            {
                ClassInt = 1;
            }
            if (charstorage.StorageList[3] == 3)
            {
                ClassInt = 2;
            }
            if (charstorage.StorageList[3] == 4)
            {
                ClassInt = 3;
            }
        }

        updateClass();

        if (roundswon > 0)
        {
            if (this.name == "Ally#1")
            {
                health = healthscript.character1health;
            }
            if (this.name == "Ally#2")
            {
                health = healthscript.character2health;
            }
            if (this.name == "Ally#3")
            {
                health = healthscript.character3health;
            }
            if (this.name == "Ally#4")
            {
                health = healthscript.character4health;
            }
        }
    }
Пример #25
0
 // Start is called before the first frame update
 void Awake()
 {
     roundCounter        = RoundCounter.instance;
     roundCounter.round += 1;
     GameStart();
 }
Пример #26
0
 // Use this for initialization
 void Start()
 {
     InMove = false;
     InPause = false;
     decisions = transform.GetComponent<Decisions>();
     CurrentSel = Camera.main.GetComponent<selection>();
     CurrentRC = Camera.main.GetComponent<RoundCounter>();
     playerBList = new List<Transform>();
     firstPhaseList = new List<Transform>();
     secondPhaseList = new List<Transform>();
     thirdPhaseList = new List<Transform>();
 }
Пример #27
0
 // Use this for initialization
 void Start()
 {
     attacker = transform.parent.parent;
     chessStorage = Camera.main.GetComponent<RoundCounter>();
 }
 public static void Only(string key, RoundCounter when, Action action)
 {
     Try(key, (int)when, action);
 }
Пример #29
0
 // Use this for initialization
 void Start()
 {
     rc = Camera.mainCamera.GetComponent <RoundCounter>();
 }
Пример #30
0
 // Use this for initialization
 void Start()
 {
     currentSelect = this.GetComponent<selection>();
     segment = btSize;
     posMoveBt =new Rect(leftMargin,topMargin,btSize,btSize);
     posSummonBt = new Rect(leftMargin,topMargin+segment,btSize,btSize);
     posAttackBt = new Rect(leftMargin,topMargin+segment*2,btSize,btSize);
     posSkillBt = new Rect(leftMargin,topMargin+segment*3,btSize,btSize);
     posDefenseBt = new Rect(leftMargin,topMargin+segment*4,btSize,btSize);
     posEndTurnBt = new Rect(leftMargin,topMargin+segment*5,btSize,btSize);
     MainGuiShow = false;
     mousePos = new Vector2();
     mainStyle.font = MainFont;
     mainStyle.normal.textColor = Color.white;
     mainStyle.fontSize = 20;
     subStyle = new GUIStyle(mainStyle);
     subStyle.fontSize = 16;
     subStyle.normal.textColor = new Color(.8f,.8f,.8f,1.0f);
     subStyle.onHover.textColor = Color.white;
     players = this.GetComponent<RoundCounter>();
     numIcon = this.GetComponent<NumIconVault>();
     infoUI = this.GetComponent<InfoUI>();
     chessUI = this.GetComponent<MainInfoUI>();
     InSecondTutor = false;
     init = GameObject.Find("InitStage").transform.GetComponent<InitStage>();
 }
Пример #31
0
 // Use this for initialization
 void Start()
 {
     aider = transform.parent.parent;
     chessStorage = Camera.main.GetComponent<RoundCounter>();
     CommonFX cFX  = Camera.main.GetComponent<CommonFX>();
     fxBuffAtk = cFX.BuffAtk;
     fxBuffCritiq = cFX.BuffCritiq;
     fxBuffDef = cFX.BuffDef;
     fxBuffMove = cFX.BuffMove;
     fxBuffRange = cFX.BuffRange;
     fxBuffSkill = cFX.BuffSkill;
 }
Пример #32
0
 // Use this for initialization
 void Start()
 {
     currentSelect = Camera.main.GetComponent <selection>();
     currentRC     = Camera.main.GetComponent <RoundCounter>();
 }
Пример #33
0
 // Use this for initialization
 void Start()
 {
     currentSelect = Camera.main.GetComponent<selection>();
     currentRC = Camera.main.GetComponent<RoundCounter>();
 }