//  public int index = 0;
    void Awake()
    {
        Sc             = this;
        Time.timeScale = 1f;

        btnactive[0].interactable = false;
        btnactive[1].interactable = false;
        btnactive[2].interactable = false;
    }
Esempio n. 2
0
        public SwitchArgument(SwitchCharacter character, String switchText,
            String help, String error, int level)
        {
            IsSet = false;

            SwitchCharacter = character;
            Switch = switchText;
            IsOptional = true;
            HelpText = help;
            Level = level;
            ErrorText = error;
        }
Esempio n. 3
0
        public SwitchArgument(SwitchCharacter character, String switchText,
                              String help, String error, int level)
        {
            IsSet = false;

            SwitchCharacter = character;
            Switch          = switchText;
            IsOptional      = true;
            HelpText        = help;
            Level           = level;
            ErrorText       = error;
        }
        public SwitchedContentArgument(String name, SwitchCharacter switchChar,
                                       String switchText, SeparatorCharacter sepChar, bool optional, bool multi,
                                       String help, String error, int level, Regex regex)
        {
            IsSet     = false;
            valueList = new List <T>();

            SwitchCharacter    = switchChar;
            Switch             = switchText;
            SeparatorCharacter = sepChar;
            IsOptional         = optional;
            IsSeveralTimes     = multi;
            HelpText           = help;
            Level             = level;
            ErrorText         = error;
            RegularExpression = regex;
            Name = name;
        }
Esempio n. 5
0
    // Update is called once per frame
    void Update()
    {
        GameObject      player;
        Timer           t  = new Timer();
        SwitchCharacter sc = new SwitchCharacter();

        if (t.Team() == 0)
        {
            int i = sc.character();
            player = characters[i];
            AttackTeamA(player);
        }
        else if (t.Team() == 1)
        {
            int i = sc.defender();
            player = charactersB[i];
            AttackTeamB(player);
        }
    }
Esempio n. 6
0
 public SwitchArgument(SwitchCharacter character, String switchText,
     String help)
     : this(character, switchText, help, "%message%")
 {
 }
Esempio n. 7
0
 public SwitchArgument(SwitchCharacter character, String switchText,
     String help, String error)
     : this(character, switchText, help, error, 0)
 {
 }
Esempio n. 8
0
 /// <summary>
 /// Create a default help argument with the given switch character. Text is always '?'
 /// </summary>
 /// <param name="character">Switch character</param>
 /// <returns>Default help argument</returns>
 public static SwitchArgument CreateHelpArgument(SwitchCharacter character)
 {
     return new SwitchArgument(character, "?", "Show this help page");
 }
 public SwitchedContentArgument(String name, SwitchCharacter switchChar,
                                String switchText, SeparatorCharacter sepChar, String help)
     : this(name, switchChar, switchText, sepChar, false, help)
 {
 }
 public SwitchedContentArgument(String name, SwitchCharacter switchChar,
                                String switchText, SeparatorCharacter sepChar, bool optional, bool multi,
                                String help)
     : this(name, switchChar, switchText, sepChar, optional, multi, help, "%message%")
 {
 }
 public SwitchedContentArgument(String name, SwitchCharacter switchChar,
                                String switchText, SeparatorCharacter sepChar, bool optional, bool multi,
                                String help, String error, int level)
     : this(name, switchChar, switchText, sepChar, optional, multi, help, error, level, null)
 {
 }
Esempio n. 12
0
 public SwitchArgument(SwitchCharacter character, String switchText,
                       String help)
     : this(character, switchText, help, "%message%")
 {
 }
Esempio n. 13
0
 public SwitchArgument(SwitchCharacter character, String switchText,
                       String help, String error)
     : this(character, switchText, help, error, 0)
 {
 }
Esempio n. 14
0
 /// <summary>
 /// Create a default help argument with the given switch character. Text is always '?'
 /// </summary>
 /// <param name="character">Switch character</param>
 /// <returns>Default help argument</returns>
 public static SwitchArgument CreateHelpArgument(SwitchCharacter character)
 {
     return(new SwitchArgument(character, "?", "Show this help page"));
 }
Esempio n. 15
0
    // Update is called once per frame
    void Update()
    {
        //ChangePosition();
        SwitchCharacter sc = new SwitchCharacter();
        int             i  = sc.character();

        player = characters[i];
        float Ed = Vector3.Distance(transform.position, player.transform.position);

        //Debug.Log(Ed);
        //SetPosition();

        /*if(agent.enabled == true && agent.remainingDistance < remainingDistance)
         * {
         *  agent.enabled = true;
         *  anim.SetInteger("speed", 0);
         *  anim.SetBool("isWalking", false);
         * // StartCoroutine(RandomMovementtoWayPoint());
         *  //Debug.Log("Arrived ...");
         * }*/

        //Debug.Log(Vector3.Distance(transform.position, player.transform.position));

        /*if(Vector3.Distance(transform.position, player.transform.position) < alertDistance)
         * {
         *  if (Vector3.Distance(transform.position, player.transform.position) <= agent.stoppingDistance)
         *  {
         *      FaceTarget();
         *      anim.SetBool("isProning", true);
         *      anim.SetInteger("speed", 1);
         *  }
         *  //agent.enabled = false;
         * // Dodge();
         * }*/

        if (Vector3.Distance(transform.position, player.transform.position) <= attackingDistance)// && Vector3.Distance(transform.position, player.transform.position) >= alertDistance)
        {
            //Debug.Log("In Red Circle "+ Vector3.Distance(transform.position, player.transform.position));
            agent.enabled = true;
            agent.SetDestination(player.transform.position);
            FaceTarget();
            if (Vector3.Distance(transform.position, player.transform.position) <= 1.7f)//stoppingDistance)
            {
                //Debug.Log("Less Than Rem Dist : "+ Vector3.Distance(transform.position, player.transform.position));
                FaceTarget();
                anim.SetBool("isWalking", false);
                anim.SetBool("GrabLegs", false);
                anim.SetBool("isProning", true);
                anim.SetInteger("speed", 1);
                anim.Play("Prone Idle");
            }
            //Debug.Log("Attacking");
            //agent.enabled = false;
            //Vector3 targetDir = player.transform.position - transform.position;
            //float angle = Vector3.Angle(targetDir, transform.forward);
            //Debug.Log(angle);
            //if (angle < attackAngle)
            //{
            //

            Attack();
            //}
        }
        // Idle
        else if (Vector3.Distance(transform.position, player.transform.position) > attackingDistance)
        {
            //Debug.Log("Outside circle " + Vector3.Distance(transform.position, player.transform.position));
            anim.SetInteger("speed", 0);
            anim.SetBool("isWalking", false);
            anim.SetBool("GrabLegs", false);
            anim.SetBool("isWalkingBack", false);
            anim.SetBool("isAttacking", false);
            anim.SetBool("isDodging", false);
            StartCoroutine(RandomMovementtoWayPoint());
        }

        /*else
         * {
         *  agent.enabled = true;
         *  Move();
         *  if(Vector3.Distance(transform.position, player.transform.position) <= attackingDistance)
         *  {
         *      agent.enabled = false;
         *      anim.SetBool("isWalking", false);
         *      anim.SetInteger("speed", 0);
         *      Attack();
         *      anim.SetBool("isWalking", false);
         *  }
         * }*/

        if (attacked == true)
        {
            agent.enabled = true;
            agent.SetDestination(player.transform.position);
        }
    }