public void Initialize(BaseMotor motor, AbilityList abilities, AnimationSync animations, bool isOnServer) { Motor = motor; Abilities = abilities; Animations = animations; IsOnServer = isOnServer; }
// Use this for initialization void Start() { _animator = GetComponent <Animator>(); _animator.SetInteger("WeaponState", WeaponState); _animator.SetBool("NonCombat", false); _animator.SetBool("Idling", true); _animSync = GetComponentInParent <AnimationSync>(); _animSync.SubscribeTriggerAnimation(OnAnimationTriggered); }
void Start() { _motor = _bodyIdentity.gameObject.GetComponent <BaseMotor>(); _abilities = _bodyIdentity.gameObject.GetComponent <AbilityList>(); _animationSync = _bodyIdentity.gameObject.GetComponent <AnimationSync>(); if (isServer) { _abilities.GrantAbility(new AbilityJump(_motor, _animationSync), AbilitySlot.Jump); _abilities.GrantAbility(new AbilityBasicAttack(_motor, _animationSync), AbilitySlot.Attack1); } }
// Update is called once per frame void Update() { // Animate var animationIndex = AnimationSync.GetAnimationIndex(Mathf.FloorToInt(20.0f / conveyorSpeed)) % sprites.Length; spriteRenderer.sprite = sprites[animationIndex]; // Update rotation from direction bool dequeue = false; foreach (GenericFood obj in conveyedObjects) { if (currentDirection == DIRECTION.NORTH) { obj.transform.position += new Vector3(0, 0.005f) * conveyorSpeed; } if (currentDirection == DIRECTION.EAST) { obj.transform.position += new Vector3(0.005f, 0) * conveyorSpeed; } if (currentDirection == DIRECTION.SOUTH) { obj.transform.position += new Vector3(0, -0.005f) * conveyorSpeed; } if (currentDirection == DIRECTION.WEST) { obj.transform.position += new Vector3(-0.005f, 0) * conveyorSpeed; } if (Mathf.Abs(obj.transform.position.x) - Mathf.Abs(transform.position.x) > Mathf.Abs(this.gameObject.GetComponent <BoxCollider2D>().bounds.size.x) || Mathf.Abs(obj.transform.position.y) - Mathf.Abs(transform.position.y) > Mathf.Abs(this.gameObject.GetComponent <BoxCollider2D>().bounds.size.y)) { if (nextConveyor == null) { idleObjects.Add(obj); dequeue = true; } else { nextConveyor.addConveyedItem(obj); dequeue = true; } } } if (dequeue) { conveyedObjects.Dequeue(); } }
// Use this for initialization void Start() { animator = gameObject.GetComponent <Animator>(); _rigidbody2D = gameObject.GetComponent <Rigidbody2D>(); inventory = gameObject.GetComponent <Inventory>(); equipment = gameObject.GetComponent <Equipment>(); animationSync = gameObject.GetComponent <AnimationSync>(); // equipment requires an animation sync // to sync the animation of worn items equipment.animationSync = animationSync; // get the speech element and randomly // update it speech = GetComponentInChildren <Text>(); StartCoroutine(saySomething()); GameState.SetState(GameState.States.Running); }
public void UpdateObjectsFromStates() { if (OWInput.GetInputMode() == InputMode.None) { // ? why is this here lmao return; } if (CameraBody == null) { return; } FlashLight?.UpdateState(FlashlightActive); Translator?.ChangeEquipState(TranslatorEquipped); ProbeLauncher?.ChangeEquipState(ProbeLauncherEquipped); Signalscope?.ChangeEquipState(SignalscopeEquipped); AnimationSync.SetSuitState(SuitedUp); }
void Start() { playerAction = gameObject.GetComponent <PlayerAction>(); animations = gameObject.GetComponent <AnimationSync>(); movementScript = gameObject.GetComponent <MoveScriptCharacterController>(); }
public AbilityJump(BaseMotor caster, AnimationSync animSync) : base(caster, animSync, Cooldown) { }
public BaseAbility(BaseMotor caster, AnimationSync animSync, float cooldown) { _caster = caster; _animSync = animSync; _cooldown = cooldown; }
public AbilityBasicAttack(BaseMotor caster, AnimationSync animSync) : base(caster, animSync, Cooldown) { }