public virtual void Initialize() { InitStats(); SpriteRenderer = GetComponent <SpriteRenderer>(); AnimHelper = GetComponentInChildren <AnimHelper>(); if (AnimHelper != null) { AnimHelper.Initialize(this); } EffectDelivery = GetComponentInChildren <EffectDelivery>(); Movement = GetComponent <EntityMovement>(); if (Movement != null) { Movement.Initialize(this); } InitFSM(); Health = GetComponent <HealthDeathManager>(); if (Health != null) { Health.Initialize(this); } }
public virtual void Initialize(Effect parentEffect, LayerMask mask, Transform parentToThis = null) { this.parentEffect = parentEffect; this.LayerMask = mask; this.impactEffect = parentEffect.effectZoneInfo.effectZoneImpactVFX; this.spawnEffect = parentEffect.effectZoneInfo.effectZoneSpawnVFX; AnimHelper = GetComponent <AnimHelper>(); if (parentToThis != null) { transform.SetParent(parentToThis, false); transform.localPosition = Vector3.zero; } if (string.IsNullOrEmpty(parentEffect.effectZoneInfo.effectZoneAnimTrigger) == false) { if (AnimHelper == null) { AnimHelper helper = gameObject.AddComponent <AnimHelper>(); helper.PlayAnimTrigger(parentEffect.effectZoneInfo.effectZoneAnimTrigger); return; } AnimHelper.PlayAnimTrigger(parentEffect.effectZoneInfo.effectZoneAnimTrigger); } //Debug.Log("Effect zone created"); TestVelocitySwap(); }
protected override void OnResume() { base.OnResume(); ShowDisclaimerDialog(); amountLbl = FindViewById <TextView>(Resource.Id.amountLbl); var nextAmountBtn = FindViewById <Button>(Resource.Id.nextAmountBtn); var donateAmountBtn = FindViewById <Button>(Resource.Id.donateAmountBtn); nextAmountBtn.Click += delegate { ++currentIndex; if (currentIndex > 4) { currentIndex = 0; } AnimHelper.Animate(amountLbl, "rotationY", 1000, new AnticipateInterpolator(), 0, 360); amountLbl.Text = amounts[currentIndex]; }; donateAmountBtn.Click += delegate { var intent = new Intent(Intent.ActionView); var url = amountLbl.Text != "Your choice" ? $"{AppResources.PaypalLink}{amountLbl.Text.Substring(1, amountLbl.Text.Length - 1)}" : AppResources.PaypalLink; intent.SetData(Android.Net.Uri.Parse(url)); StartActivity(Intent.CreateChooser(intent, "Thank you for your donation! Please select any browser here.")); }; }
public void Start() { var player = GameObject.Find("Player"); _aMa = GameObject.Find("AudioManager").GetComponent <AudioManager>(); _chCam = Camera.main.GetComponent <ChappersCam>(); _worldMover = GameObject.Find("Road").GetComponent <WorldMover>(); _anim = player.GetComponent <AnimHelper>(); _spin = player.GetComponentInChildren <DonutSpin>(); _donut = player.GetComponent <Donut>(); }
void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } //thing = actor.GetComponent<Thing>(); }
public void CheckIfEmpty(EditText editText, string inputDescription) { editText.SetBackgroundResource(Resource.Color.primaryLight); if (!String.IsNullOrEmpty(editText.Text) || !String.IsNullOrWhiteSpace(editText.Text)) { valid = true; } else { string errorString = $"{inputDescription} is required."; valid = false; editText.SetError(errorString, null); editText.Background.SetColorFilter(Color.Tomato, PorterDuff.Mode.SrcIn); AnimHelper.Animate(editText, "rotationY", 500, new AnticipateOvershootInterpolator(), 20, 0, -20, 0); } }
private void FinishItemChange(bool WasLeftSwipe) { float direction = WasLeftSwipe ? 700 : -700; AnimHelper.Animate(detailsView, "translationX", 700, new AnticipateOvershootInterpolator(), direction, 0); ideaTitleLbl.Text = item.Title; ideaDescriptionLbl.Text = item.Description; if (item.Note == null) { noteCard.Visibility = ViewStates.Gone; } else { ShowNote(item.Note); } CheckAndSetBookmark(); }
private void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); animHelper = GetComponent <AnimHelper>(); }
void Start() { //Initialise the score and UI to display it. Score = 0; _scoreHUD = GameObject.Find("HUDCanvas").GetComponentInChildren <TextMeshProUGUI>(); //Grab the AnimHelper, adds some functionality to calling animations. _animHelper = this.GetComponent <AnimHelper>(); //Grab world mover _worldMover = GameObject.Find("Road").GetComponent <WorldMover>(); //Initialise the left and right constrains, or "walls". _leftConstraint = -5f; _rightConstraint = 5f; //Communicate to the "ChappersCam" that we want that script enabled. Camera.main.GetComponent <ChappersCam>().RunCamera = true; //Initialise IsJumping. IsJumping = false; //Initialise IsDead. IsDead = false; //Turn back all ye who do not wish a painful death - Will //Initialise Input handler inh = GameObject.Find("Player").AddComponent <InputHandler>(); //Track Keys inh.TrackInput(KeyCode.Space, InputType.Button); inh.TrackInput(KeyCode.A, InputType.Button); inh.TrackInput(KeyCode.D, InputType.Button); inh.TrackInput(KeyCode.LeftArrow, InputType.Button); inh.TrackInput(KeyCode.RightArrow, InputType.Button); /*////////////////////////////// * /// Define Events /// * //////////////////////////////*/ //Move Left inh.AddEvent(KeyCode.LeftArrow, InputEventType.Down, delegate(InputData inp) { _moveDirection = -1f; if (!IsDead) { _animHelper.Donut_BeginMoveLeft_Start(0f); } }); inh.AddEvent(KeyCode.LeftArrow, InputEventType.Up, delegate(InputData inp) { if (_moveDirection == -1f) { _moveDirection = 0f; } }); inh.AddEvent(KeyCode.A, InputEventType.Down, delegate(InputData inp) { _moveDirection = -1f; if (!IsDead) { _animHelper.Donut_BeginMoveLeft_Start(0f); } }); inh.AddEvent(KeyCode.A, InputEventType.Up, delegate(InputData inp) { if (_moveDirection == -1f) { _moveDirection = 0f; } }); //Move Right inh.AddEvent(KeyCode.RightArrow, InputEventType.Down, delegate(InputData inp) { _moveDirection = 1f; if (!IsDead) { _animHelper.Donut_BeginMoveRight_Start(0f); } }); inh.AddEvent(KeyCode.RightArrow, InputEventType.Up, delegate(InputData inp) { if (_moveDirection == 1f) { _moveDirection = 0f; } }); inh.AddEvent(KeyCode.D, InputEventType.Down, delegate(InputData inp) { _moveDirection = 1f; if (!IsDead) { _animHelper.Donut_BeginMoveRight_Start(0f); } }); inh.AddEvent(KeyCode.D, InputEventType.Up, delegate(InputData inp) { if (_moveDirection == 1f) { _moveDirection = 0f; } }); //Jump inh.AddEvent(KeyCode.Space, InputEventType.Down, delegate(InputData inp) { if (!IsJumping && !IsDead) { _animHelper.Donut_Jump_Start(0f); } }); }
private void Awake() { animHelper = GetComponent <AnimHelper>(); }
private void Awake() { Instance = this; }
private void Awake() { AnimHelper = GetComponentInChildren <AnimHelper>(); }
public void setAnimParameter( AnimHelper _helper ) { //Debug.Log("setAnimParameter -> _helper"); resetAnimParameter(); mAnimHelper = _helper; }