void Start() { mAnimator = GetComponent <Animator>(); mMotor = GetComponent <CharacterMotor>(); mCharacterProperty = GetComponent <CharacterProperty>(); runSpeed = mCharacterProperty.WalkSpeed; mObservableStateMachineTrigger = mAnimator.GetBehaviour <ObservableStateMachineTrigger>(); mObservableStateMachineTrigger .OnStateEnterAsObservable() .Subscribe(info => { OnEnterState(info.StateInfo); }); mObservableStateMachineTrigger .OnStateExitAsObservable() .Subscribe(info => { OnExitState(info.StateInfo); }); mTargetingController = GetComponent <TargetingController>(); mTargetingController.CurrentTarget = target; }
// Use this for initialization void Start() { mAnimator = GetComponent <Animator> (); mCharacterProperty = GetComponent <CharacterProperty> (); mTargetingController = GetComponent <TargetingController>(); mSkills = new Dictionary <int, Ability> (); mActivatedSkills = new Queue <Ability> (); InitSkills(); mAttackColliderDisposable = new SingleAssignmentDisposable(); mActionController = GetComponent <AnimatorController>(); mActionController.OnHitStartAsObservable.Subscribe(info => { if (info.ability == -1 || mCastingAbility == null) { return; } AbilityActionStatus status = mCastingAbility.Perform(mTarget); if (status == AbilityActionStatus.Running) { mActivatedSkills.Enqueue(mCastingAbility); } }); mActionController.OnHitEndAsObservable.Subscribe(info => { mCastingAbility = null; mTarget = null; }); }
// Start is called before the first frame update void Start() { if (photonView.IsMine) { player = gameObject; targetingController = player.GetComponent <TargetingController>(); } }
public override void AddToGame(IGame game) { this.targetingController = Service.Get <TargetingController>(); EntityController entityController = Service.Get <EntityController>(); this.offensiveHealerNodeList = entityController.GetNodeList <OffensiveHealerNode>(); this.defensiveHealerNodeList = entityController.GetNodeList <DefensiveHealerNode>(); this.flip = 0; }
public override void AddToGame(IGame game) { this.entityController = Service.Get <EntityController>(); this.offensiveTroopNodeList = this.entityController.GetNodeList <OffensiveTroopNode>(); this.offensiveHealerNodeList = this.entityController.GetNodeList <OffensiveHealerNode>(); this.spatialIndexController = Service.Get <SpatialIndexController>(); this.targetingController = Service.Get <TargetingController>(); this.combatTriggerManager = Service.Get <CombatTriggerManager>(); this.reusableResetReevaluateTargetSet = new HashSet <ShooterComponent>(); }
public override void AddToGame(Game game) { this.targetingController = Service.TargetingController; EntityController entityController = Service.EntityController; this.offensiveTroopNodeList = entityController.GetNodeList <OffensiveTroopNode>(); this.defensiveTroopNodeList = entityController.GetNodeList <DefensiveTroopNode>(); this.turretNodeList = entityController.GetNodeList <TurretNode>(); this.flip = 0; }
private void Start() { targetingController = GameObject.FindGameObjectWithTag("TargetController").GetComponent <TargetingController>(); if (isLocalPlayer) { targetingController.setPlayerConnectionObject(this); CmdSpawnLocalPlayerWizard(this.transform.position); } }
// Start is called before the first frame update public void Awake() { if (photonView.IsMine) { player = gameObject; targetingController = player.GetComponent <TargetingController>(); energyBar = GameObject.Find("ManaBar").GetComponentInChildren <EnergyBar>(); populateSpells(); } }
void ManualTarget(AbilityInstance abilityInstance) { TargetingController targetingController = abilityInstance.Caster.Team.TargetingController; targetingController.ChooseNewTargets(Template.Targeting.NumTargetsRequired, character => Template.Targeting.SelectTargetCheck(character, abilityInstance), targets => { abilityInstance.Targets.AddRange(targets); abilityInstance.Execute(); }, abilityInstance.Cancel); }
// Start is called before the first frame update void Start() { hasSpellPrimed = false; player = GameObject.Find("Player"); targetingController = player.GetComponent <TargetingController>(); energyBar = Camera.main.GetComponentInChildren <EnergyBar>(); AudioSource notEnoughEnergyAudioSource = gameObject.AddComponent(typeof(AudioSource)) as AudioSource; notEnoughEnergyAudioSource.clip = notEnoughEnergyAudioClip; populateSpells(); }
public LightSaberHitEffect(int radius, int gridX, int gridZ, Transform heroTrans, string centerFx, FactionType faction) { this.targetLocators = new List <GameObject>(); this.adjescentLocators = new List <GameObject>(); this.fxInstances = new List <GameObject>(); this.targetBuildings = new List <SmartEntity>(); this.entityFlasher = new EntityFlasher(); this.heroTrans = heroTrans; if (heroTrans != null) { TargetingController.TraverseSpiralToFindTargets(radius, gridX, gridZ, new TargetingController.TargetValidator(this.FindClosest), null, false); StaticDataController staticDataController = Service.StaticDataController; string text = null; string cookie = null; EffectsTypeVO effectsTypeVO; if (faction == FactionType.Empire) { effectsTypeVO = staticDataController.Get <EffectsTypeVO>("effect199"); } else { effectsTypeVO = staticDataController.Get <EffectsTypeVO>("effect197"); } if (effectsTypeVO != null) { text = effectsTypeVO.AssetName; } effectsTypeVO = staticDataController.Get <EffectsTypeVO>("effect198"); if (effectsTypeVO != null) { cookie = effectsTypeVO.AssetName; } if (centerFx != null) { Service.AssetManager.Load(ref this.circularHitFxHandle, centerFx, new AssetSuccessDelegate(this.OnLoadCircularFx), null, null); } if (this.targetLocators.Count > 0) { if (text != null) { Service.AssetManager.Load(ref this.hitFxHandle, text, new AssetSuccessDelegate(this.OnLoadHitFx), null, cookie); } else { Service.Logger.Error("LightSaber Hit Effect not found"); } } } }
// Start is called before the first frame update void Start() { rigidbody2d = GetComponent <Rigidbody2D>(); currentHealth = maxHealth; animator = GetComponent <Animator>(); playerClass = GetComponent <Warrior>(); chargeEffect = GetComponent <ParticleSystem>(); chargeEffectRotation = GetComponent <ParticleSystem>().shape.rotation.z; clickHandler = GetComponent <ClickHandler>(); spellHandler = GetComponent <SpellHandler>(); targetingController = GetComponent <TargetingController>(); timeSinceAutoAttack = attackSpeed; lastCharge = Time.time; energyBar = Camera.main.GetComponentInChildren <EnergyBar>(); healthBar = Camera.main.GetComponentInChildren <HealthBar>(); }
// Start is called before the first frame update void Start() { player = GameObject.Find("Player"); targetingController = player.GetComponent <TargetingController>(); }