예제 #1
0
 public CAim(int _id, string _name, string _description, AimType _type)
 {
     id          = _id;
     name        = _name;
     description = _description;
     type        = _type;
 }
예제 #2
0
        // Movement states:
        //  - moving
        //  - stopped
        //  - paused
        //  - chasing
        //  - shooting??

        //-----------------------------------------------------------------------------
        // Constructor
        //-----------------------------------------------------------------------------

        public BasicMonster()
        {
            color         = MonsterColor.Red;
            MaxHealth     = 1;
            ContactDamage = 1;

            scaleAnimationSpeed         = false;
            playAnimationOnlyWhenMoving = true;
            isAnimationHorizontal       = false;

            moveSpeed = 0.5f;
            changeDirectionsOnCollide  = true;
            syncAnimationWithDirection = true;
            movesInAir = false;
            stopTime.Set(30, 60);
            moveTime.Set(30, 50);

            chargeType     = ChargeType.None;
            chargeDuration = RangeI.Zero;

            shootType           = ShootType.None;
            aimType             = AimType.Forward;
            projectileType      = null;
            shootSpeed          = 2.0f;
            projectileShootOdds = 5;
            shootPauseDuration  = 30;
            shootSound          = null;
        }
예제 #3
0
        public void UpdateAimsFromGrid(RadGridView gridView)
        {
            List <int> idsInTable = new List <int>();

            for (int row = 0; row < gridView.RowCount; row++)
            {
                int     id   = Common.convertNullInt(gridView.Rows[row].Cells["columnID"].Value);
                string  name = Common.convertNullString(gridView.Rows[row].Cells["columnName"].Value);
                string  desc = Common.convertNullString(gridView.Rows[row].Cells["columnDescription"].Value);
                AimType type = (AimType)gridView.Rows[row].Cells["columnType"].Value;

                if (!aims.ContainsKey(id))
                {
                    id = this.addAim(name, desc, type);
                }
                else
                {
                    aims[id].setName(name);
                    aims[id].description = desc;
                    aims[id].type        = type;
                }
                idsInTable.Add(id);
            }

            foreach (int id in aims.Keys.ToList())
            {
                if (!idsInTable.Contains(id))
                {
                    this.removeAim(id);
                }
            }
        }
예제 #4
0
        public int addAim(string _name, string _description, AimType _type)
        {
            int newID = calcNewID();

            aims.Add(newID, new CAim(newID, _name, _description, _type));
            return(newID);
        }
예제 #5
0
 public CAim(int _id, string _name, string _description, AimType _type, List <int> _personsList)
 {
     id          = _id;
     name        = _name;
     description = _description;
     type        = _type;
     personsId   = _personsList;
 }
예제 #6
0
    public void SetType(AimType type)
    {
        int index = GetIndexOf(type);

        if (index != -1)
        {
            aimTexture.mainTexture = textures [index].texture;
        }
    }
예제 #7
0
    public void SpawnPlayer()
    {
        GameObject ship = Instantiate(playerShip);

        switch (moveType)
        {
        case MoveType.Controller_Move:
            ship.AddComponent <Controller360Move>();
            break;

        case MoveType.Keyboard_Move:
            ship.AddComponent <KeyboardMove>();
            break;
        }

        ShootController shooter = null;

        switch (shootType)
        {
        case ShootType.Controller_Shoot:
            shooter = ship.AddComponent <Controller360Shoot>();
            break;

        case ShootType.Keyboard_Shoot:
            shooter = ship.AddComponent <KeyboardShoot>();
            break;
        }

        if (shooter != null)
        {
            shooter.projectilePre = projectile;
        }

        switch (aimType)
        {
        case AimType.Controller_Aim:
            ship.AddComponent <Controller360Aim>();
            break;

        case AimType.Mouse_Aim:
            ship.AddComponent <MouseAim>();
            break;

        case AimType.Oculus_Aim:
            Camera.main.enabled  = false;
            ocControllerInstance = (GameObject)Instantiate(oculusController, cameraPos, Quaternion.identity);

            OculusAim oculus = ship.AddComponent <OculusAim>();
            oculus.ocCamera = ocControllerInstance;
            break;
        }

        aimTypeStatic = aimType;
    }
예제 #8
0
 private int GetIndexOf(AimType type)
 {
     for (int i = 0; i < textures.Length; i++)
     {
         if (textures [i].type == type)
         {
             return(i);
         }
     }
     return(-1);
 }
예제 #9
0
    public void SetAim(bool setActive, AimType aimType = AimType.Use)
    {
        aim.gameObject.SetActive(setActive);

        if (setActive)
        {
            if (aimType == AimType.Use)
            {
                aim.color = new Color(200, 0, 0);
            }
            else if (aimType == AimType.Damage)
            {
                aim.color = new Color(0, 200, 0);
            }
        }
    }
예제 #10
0
 public void loadAimsFromFile(string file = "")
 {
     file = (file.Length == 0) ? (fileName) : (file);
     removeAllAims();
     doc = XDocument.Load(file);
     foreach (XElement elem in doc.Root.Element(section).Elements())
     {
         int        id          = int.Parse(elem.Element("aimId").Value.ToString());
         string     name        = elem.Element("aimName").Value.ToString();
         string     desc        = elem.Element("aimDescription").Value.ToString();
         string     strtype     = elem.Element("aimType").Value.ToString();
         AimType    type        = getType(strtype);
         string     personStr   = elem.Element("personsWithAim").Value.ToString();
         List <int> personsList = Common.splitStringIntoList(personStr);
         addAim(id, name, desc, type, personsList);
     }
 }
예제 #11
0
 public AttackTrigger()
 {
     whileAttack          = whileAtk.MeleeFwd;
     aimingType           = AimType.Normal;
     skillPrefab          = new Transform[3];
     skillIcon            = new Texture2D[3];
     skillIconSize        = 80;
     attackSpeed          = 0.15f;
     atkDelay1            = 0.1f;
     skillDelay           = 0.3f;
     attackCombo          = new AnimationClip[3];
     attackAnimationSpeed = 1f;
     skillAnimation       = new AnimationClip[3];
     skillAnimationSpeed  = 1f;
     manaCost             = new int[3];
     aimIconSize          = 40;
     knock = Vector3.zero;
 }
예제 #12
0
        public void ChangeAim(AimType changeAimType)
        {
            switch (changeAimType)
            {
            case AimType.Line:
                lineRenderer.widthCurve = ThinLine;
                break;

            case AimType.Cone:
                lineRenderer.widthCurve = ConeLine;
                break;

            case AimType.CircleRange:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(changeAimType), changeAimType, null);
            }
        }
예제 #13
0
        public void CopyProperties(ThirdPersonController other)
        {
            this.m_DontDestroyOnLoad  = other.m_DontDestroyOnLoad;
            this.m_ForwardInput       = other.m_ForwardInput;
            this.m_HorizontalInput    = other.m_HorizontalInput;
            this.m_SpeedMultiplier    = other.m_SpeedMultiplier;
            this.m_AimType            = other.m_AimType;
            this.m_AimInput           = other.m_AimInput;
            this.m_AimRotation        = other.m_AimRotation;
            this.m_RotationSpeed      = other.m_RotationSpeed;
            this.m_AirSpeed           = other.m_AirSpeed;
            this.m_AirDampening       = other.m_AirDampening;
            this.m_GroundDampening    = other.m_GroundDampening;
            this.m_StepOffset         = other.m_StepOffset;
            this.m_SlopeLimit         = other.m_SlopeLimit;
            this.m_GroundLayer        = other.m_GroundLayer;
            this.m_SkinWidth          = other.m_SkinWidth;
            this.m_IdleFriction       = other.m_IdleFriction;
            this.m_MovementFriction   = other.m_MovementFriction;
            this.m_StepFriction       = other.m_StepFriction;
            this.m_AirFriction        = other.m_AirFriction;
            this.m_ForwardDampTime    = other.m_ForwardDampTime;
            this.m_HorizontalDampTime = other.m_HorizontalDampTime;

            /*this.m_LookOffset = other.m_LookOffset;
             * this.m_BodyWeight = other.m_BodyWeight;
             * this.m_HeadWeight = other.m_HeadWeight;
             * this.m_EyesWeight = other.m_EyesWeight;
             * this.m_ClampWeight = other.m_ClampWeight;*/

            this.m_Motions = new List <MotionState> ();
            for (int i = 0; i < other.Motions.Count; i++)
            {
                MotionState motion = CopyComponent <MotionState> (other.Motions [i], gameObject);
                this.m_Motions.Add(motion);
            }
        }
예제 #14
0
        private void CreatePreviousEarningsAndPayments(string providerName, string learnerRefererenceNumber, Table table, AimType paymentsAimType)
        {
            var learnerBreakdown = new EarningsAndPaymentsBreakdown {
                ProviderId = providerName
            };

            EarningAndPaymentTableParser.ParseEarningsAndPaymentsTableIntoContext(learnerBreakdown, table);

            var learningDetails = SubmissionContext.HistoricalLearningDetails.Where(x => x.AimType == paymentsAimType && x.LearnerReference.Equals(learnerRefererenceNumber, StringComparison.InvariantCultureIgnoreCase)).Single();

            long learnerUln;

            if (!string.IsNullOrEmpty(learningDetails.Uln))
            {
                learnerUln = long.Parse(learningDetails.Uln);
                LookupContext.AddUln(learnerRefererenceNumber, learnerUln);
            }
            else
            {
                learnerUln = LookupContext.AddOrGetUln(learnerRefererenceNumber);
            }


            var provider = LookupContext.AddOrGetUkprn(learnerBreakdown.ProviderId);

            var commitment = CommitmentsContext.Commitments.FirstOrDefault(x => x.ProviderId == learnerBreakdown.ProviderId && x.LearnerId == learnerRefererenceNumber);

            foreach (var earned in learnerBreakdown.ProviderEarnedTotal)
            {
                var requiredPaymentId = Guid.NewGuid().ToString();
                var month             = int.Parse(earned.PeriodName.Substring(0, 2));
                var year         = int.Parse(earned.PeriodName.Substring(3, 2)) + 2000;
                var date         = new DateTime(year, month, 1);
                var periodNumber = date.GetPeriodNumber();
                var periodName   = $"{TestEnvironment.Variables.OpaRulebaseYear}-R" + periodNumber.ToString("00");

                if (earned.Value > 0)
                {
                    PaymentsManager.SavePaymentDue(requiredPaymentId, provider, learnerUln,
                                                   commitment, learnerRefererenceNumber, periodName,
                                                   month, year, learningDetails.AimType == AimType.Programme ? (int)TransactionType.OnProgram : (int)TransactionType.OnProgrammeMathsAndEnglish
                                                   , earned.Value, learningDetails);

                    var levyPayment = learnerBreakdown.SfaLevyBudget.Where(x => x.PeriodName == earned.PeriodName).SingleOrDefault();
                    if (levyPayment != null && levyPayment.Value > 0)
                    {
                        PaymentsManager.SavePayment(requiredPaymentId, periodName, month, year,
                                                    learningDetails.AimType == AimType.Programme ? (int)TransactionType.OnProgram : (int)TransactionType.OnProgrammeMathsAndEnglish, FundingSource.Levy, levyPayment.Value);
                    }

                    var earnedFromEmployer = learnerBreakdown.ProviderEarnedFromEmployers.Where(x => x.PeriodName == earned.PeriodName).SingleOrDefault();
                    if (earnedFromEmployer != null && earnedFromEmployer.Value > 0)
                    {
                        PaymentsManager.SavePayment(requiredPaymentId, periodName, month, year,
                                                    learningDetails.AimType == AimType.Programme ? (int)TransactionType.OnProgram : (int)TransactionType.OnProgrammeMathsAndEnglish, FundingSource.CoInvestedEmployer, earnedFromEmployer.Value);
                    }

                    var coInvestedBySfaLevy = learnerBreakdown.SfaLevyCoFundBudget.Where(x => x.PeriodName == earned.PeriodName).SingleOrDefault();
                    if (coInvestedBySfaLevy != null && coInvestedBySfaLevy.Value > 0)
                    {
                        PaymentsManager.SavePayment(requiredPaymentId, periodName, month, year,
                                                    learningDetails.AimType == AimType.Programme ? (int)TransactionType.OnProgram : (int)TransactionType.OnProgrammeMathsAndEnglish, FundingSource.CoInvestedSfa, coInvestedBySfaLevy.Value);
                    }

                    var coInvestedBySfaNonLevy = learnerBreakdown.SfaNonLevyCoFundBudget.Where(x => x.PeriodName == earned.PeriodName).SingleOrDefault();
                    if (coInvestedBySfaNonLevy != null && coInvestedBySfaNonLevy.Value > 0)
                    {
                        PaymentsManager.SavePayment(requiredPaymentId, periodName, month, year,
                                                    learningDetails.AimType == AimType.Programme ? (int)TransactionType.OnProgram : (int)TransactionType.OnProgrammeMathsAndEnglish, FundingSource.CoInvestedSfa, coInvestedBySfaNonLevy.Value);
                    }

                    var aditionalPayments = learnerBreakdown.SfaLevyAdditionalPayments.Where(x => x.PeriodName == earned.PeriodName).SingleOrDefault();
                    if (aditionalPayments != null && aditionalPayments.Value > 0)
                    {
                        PaymentsManager.SavePayment(requiredPaymentId, periodName, month, year,
                                                    learningDetails.AimType == AimType.Programme ? (int)TransactionType.OnProgram : (int)TransactionType.OnProgrammeMathsAndEnglish, FundingSource.FullyFundedSfa, aditionalPayments.Value);
                    }
                }
            }
        }
예제 #15
0
 public override string ToString()
 {
     return(AimType.ToString() + " Gunsight");
 }
예제 #16
0
 public AimTypeDataSourceObject(AimType _type, string _display)
 {
     type          = _type;
     displayString = _display;
 }
예제 #17
0
 public AimComponent(AimType t)
 {
     TheType = t;
 }
예제 #18
0
	public void changeToGunMode()
	{
		if (_aimType == AimType.phoneGun)
						return;

		AimType previous = _aimType;

		gyroManager.Transfering = true;
		
		_aimType = AimType.phoneGun;

		if (AimTypeChangeEvent != null)
		{
			AimTypeChangeEvent(previous,_aimType);
		}

		JSONObject json = new JSONObject();
		json.AddField("command","changeAimMode");
		json.AddField("mode","phoneGun");

		SetEnableList (GunAimEnables,true);
		SetEnableList (ViewPortCenterEnables, false);

		communicationManager.SendJson(json);
	}
예제 #19
0
 public AimInfo(Transform pAimTransform, AimType pAimType)
 {
     aimType = pAimType;
     aimTransform = pAimTransform;
 }
예제 #20
0
 public AimTypeDataSourceObject(AimType _type, string _display)
 {
     type = _type;
     displayString = _display;
 }
예제 #21
0
 public int addAim(string _name, string _description, AimType _type)
 {
     int newID = calcNewID();
     aims.Add(newID, new CAim(newID, _name, _description, _type ) );
     return newID;
 }
예제 #22
0
 public void addAim(int _id, string _name, string _description, AimType _type, List<int> _personsList)
 {
     aims.Add(_id, new CAim(_id, _name, _description, _type, _personsList));
 }
예제 #23
0
 public CAim(int _id, string _name, string _description, AimType _type)
 {
     id = _id;
     name = _name;
     description = _description;
     type = _type;
 }
예제 #24
0
 public CAim(int _id, string _name, string _description, AimType _type, List<int> _personsList)
 {
     id = _id;
     name = _name;
     description = _description;
     type = _type;
     personsId = _personsList;
 }
예제 #25
0
 public EnemySort(AimType type)
 {
     _type = type;
 }
        // Movement states:
        //  - moving
        //  - stopped
        //  - paused
        //  - chasing
        //  - shooting??
        //-----------------------------------------------------------------------------
        // Constructor
        //-----------------------------------------------------------------------------
        public BasicMonsterOld()
        {
            color			= MonsterColor.Red;
            MaxHealth		= 1;
            ContactDamage	= 1;

            scaleAnimationSpeed			= false;
            playAnimationOnlyWhenMoving	= true;
            isAnimationHorizontal		= false;

            moveSpeed					= 0.5f;
            numMoveAngles				= 4;
            isMovementDirectionBased	= true;
            changeDirectionsOnCollide	= true;
            syncAnimationWithDirection	= true;
            movesInAir					= false;
            stopTime.Set(30, 60);
            moveTime.Set(30, 50);

            chargeType			= ChargeType.None;
            chargeDuration		= RangeI.Zero;

            shootType			= ShootType.None;
            aimType				= AimType.Forward;
            projectileType		= null;
            shootSpeed			= 2.0f;
            projectileShootOdds	= 5;
            shootPauseDuration	= 30;
        }
예제 #27
0
 public void ChangeAim(AimType new_aim)
 {
     Aim = new_aim;
 }
예제 #28
0
 public void addAim(int _id, string _name, string _description, AimType _type, List <int> _personsList)
 {
     aims.Add(_id, new CAim(_id, _name, _description, _type, _personsList));
 }
예제 #29
0
        void Inputs()
        {
            switch (tankCamera.cameraMode)
            {
            case RTC_MainCamera.CameraMode.FPS:
                aimType = AimType.Direct;
                break;

            case RTC_MainCamera.CameraMode.ORBIT:
                aimType = AimType.Orbit;
                break;
            }

            Vector3 targetPosition  = mainGun.transform.InverseTransformPoint(locatedTarget.transform.position);
            Vector3 targetPosition2 = barrel.transform.InverseTransformPoint(locatedTarget.transform.position);

            switch (RTCSettings.controllerType)
            {
            case RTC_Settings.ControllerType.Keyboard:

                switch (aimType)
                {
                case AimType.Orbit:
                    steerInput    = (targetPosition.x / targetPosition.magnitude);
                    elevatorInput = -(targetPosition2.y / targetPosition2.magnitude);
                    break;

                case AimType.Direct:
                    steerInput    = Mathf.Lerp(steerInput, Input.GetAxis(RTCSettings.mainGunXInput) * horizontalSensitivity, Time.deltaTime * 10f);
                    elevatorInput = Mathf.Lerp(elevatorInput, -Input.GetAxis(RTCSettings.mainGunYInput) * verticalSensitivity, Time.deltaTime * 10f);
                    break;
                }

                if (Input.GetKeyDown(RTCSettings.fireKB))
                {
                    Fire();
                }

                if (Input.GetKeyDown(RTCSettings.changeAmmunation))
                {
                    if (selectedAmmunation < RTC_Ammunation.Instance.ammunations.Length - 1)
                    {
                        selectedAmmunation++;
                    }
                    else
                    {
                        selectedAmmunation = 0;
                    }
                }

                break;

            case RTC_Settings.ControllerType.Mobile:

                switch (aimType)
                {
                case AimType.Orbit:
                    steerInput    = (targetPosition.x / targetPosition.magnitude);
                    elevatorInput = -(targetPosition2.y / targetPosition2.magnitude);
                    break;

                case AimType.Direct:
                    steerInput    = Mathf.Lerp(steerInput, RTC_UIMobileButtons.Instance.GetValues().aimingHorizontal *horizontalSensitivity, Time.deltaTime * 100f);
                    elevatorInput = Mathf.Lerp(elevatorInput, -RTC_UIMobileButtons.Instance.GetValues().aimingVertical *verticalSensitivity, Time.deltaTime * 100f);
                    break;
                }

                break;

            case RTC_Settings.ControllerType.Custom:

#if RTC_REWIRED
                switch (aimType)
                {
                case AimType.Orbit:
                    steerInput    = (targetPosition.x / targetPosition.magnitude);
                    elevatorInput = -(targetPosition2.y / targetPosition2.magnitude);
                    break;

                case AimType.Direct:
                    steerInput    = Mathf.Lerp(steerInput, player.GetAxis(RTCSettings.RW_mainGunXInput) * horizontalSensitivity, Time.deltaTime * 100f);
                    elevatorInput = Mathf.Lerp(elevatorInput, -player.GetAxis(RTCSettings.RW_mainGunYInput) * verticalSensitivity, Time.deltaTime * 100f);
                    break;
                }

                if (player.GetButtonDown(RTCSettings.RW_fireKB))
                {
                    Fire();
                }

                if (player.GetButtonDown(RTCSettings.RW_changeAmmunation.ToString()))
                {
                    if (selectedAmmunation < RTC_Ammunation.Instance.ammunations.Length - 1)
                    {
                        selectedAmmunation++;
                    }
                    else
                    {
                        selectedAmmunation = 0;
                    }
                }
                        #endif

                break;
            }
        }