public MemoryStream BuildCompPDF(List <CompactionData> compData) { SimpleEventHelper _pageEventHandler = new SimpleEventHelper(); Document doc = new Document(new Rectangle(288f, 144f), 10, 10, 10, 10); doc.SetPageSize(iTextSharp.text.PageSize.A4.Rotate()); MemoryStream stream = new MemoryStream(); var writer = PdfWriter.GetInstance(doc, stream); writer.CloseStream = false; writer.PageEvent = _pageEventHandler; doc.Open(); Font titleFont = FontFactory.GetFont("Arial", 14); Paragraph title; title = new Paragraph("Compaction Test", titleFont); title.Alignment = Element.ALIGN_CENTER; doc.Add(title); Image compChart = Image.GetInstance(@"C:\Users\Public\CompChart.png"); compChart.ScaleAbsolute(750, 460); compChart.SetAbsolutePosition(30, doc.PageSize.Height - 525); doc.Add(compChart); doc.Close(); byte[] byteInfo = stream.ToArray(); stream.Write(byteInfo, 0, byteInfo.Length); stream.Position = 0; return(stream); }
public virtual void Awake() { if (attribute == null) { attribute = new RoleAttribute(); } if (buffs == null) { buffs = new List <BaseBuff>(); } eventHelper = GetComponentInChildren <SimpleEventHelper>(); }
// Update is called once per frame void Awake() { GameObject gameManager = GameObject.FindGameObjectWithTag("GameController"); prafabHolder = gameManager.GetComponent <PrafabHolder>(); player = GetComponent <Player>(); shootController = GetComponent <ShootController>(); playerController = GetComponent <PlayerController>(); animationController = GetComponentInChildren <PlayerAnimationController>(); eventHelper = GetComponentInChildren <SimpleEventHelper>(); eventHelper.notifyRangeAttack += OnAttackFired; }
// Fix Call void Awake() { GameObject gameManager = GameObject.FindGameObjectWithTag("GameController"); prafabHolder = gameManager.GetComponent <PrafabHolder>(); playerMovementController = gameObject.GetComponentInParent <PlayerMovementController>(); animationController = GetComponentInChildren <PlayerAnimationController>(); eventHelper = GetComponentInChildren <SimpleEventHelper>(); player = GetComponent <Player>(); shootController = GetComponent <ShootController>(); attackController = GetComponent <AttackController>(); autoAming = GetComponent <AutoAming>(); }
private void Awake() { animator = gameObject.transform.GetComponent <Animator>(); eventHelper = GetComponent <SimpleEventHelper>(); eventHelper.notifyFirstPhaseComplete += SecondPhase; animationState = AnimationState.IDLE; previousState = AnimationState.NONE; ai = GetComponent <BaseAI>(); exceptionList = new List <ExceptionState>(); exceptionOnceQueue = new Queue <ExceptionState>(); AnimationClip attackClip = GetAnimationClipByName("attack"); if (attackClip != null) { attackClipLength = attackClip.length; } }
public virtual void Awake() { baseAgentController = transform.GetComponent <BaseAgentController>(); GameObject gameManager = GameObject.FindGameObjectWithTag("GameController"); prafabHolder = gameManager.GetComponent <PrafabHolder>(); aiUtils = gameManager.GetComponentInChildren <AIUtils>(); animationController = transform.GetComponentInChildren <CustomAnimationController>(); eventHelper = transform.GetComponentInChildren <SimpleEventHelper>(); shootPoint = aiUtils.GetShootPoint(transform); player = GameObject.FindGameObjectWithTag("Player"); currentRole = GetComponent <Enemy>(); currentRole.statusManager.notifyStatusChange += OnStatusChange; eventHelper.notifyGetHit += OnGetHit; currentState = AIState.IDLE; stateStartTime = Time.time; progress = AIProgress.END; resetPatrolPoint(); }
public virtual void Start() { GameObject gameManager = GameObject.FindGameObjectWithTag("GameController"); prafabHolder = gameManager.GetComponent <PrafabHolder>(); holder = GetComponentInParent <Role>(); PlayerController playerController = GetComponentInParent <PlayerController>(); BaseAI baseAI = GetComponentInParent <BaseAI>(); if (baseAI != null) { eventHelper = baseAI.eventHelper; } if (playerController != null) { eventHelper = playerController.eventHelper; } RegisterEventListener(); OnBuffApply(); ShowEffect(OnApplyEffect); ShowEffect(LivingEffect); }