예제 #1
0
파일: Avatar.cs 프로젝트: reaganq/mixabots
 void Awake()
 {
     characterMotor  = GetComponent <CharacterMotor>();
     actionManager   = GetComponent <CharacterActionManager>();
     animationTarget = PelvisBone.GetComponent <Animation>();
     _myTransform    = this.transform;
 }
예제 #2
0
 public virtual void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     characterAnimation = target;
     characterTransform = character;
     characterManager   = actionManager;
     characterCollider  = masterCollider;
 }
예제 #3
0
	public override void Awake () {
	    
		base.Awake();
        //input = GetComponent<CharacterInputController>();
        myActionManager = GetComponent<CharacterActionManager>();
		if(!myStatus.myPhotonView.isMine)
			enabled = false;
	}
예제 #4
0
	public void Enable(CharacterActionManager actionManager)
	{
		cam = actionManager;
		if(actionAnimation.clip != null)
		{
			StartCoroutine(TransferAnimation(actionAnimation));
			Debug.Log("transferring new animation");
		}
		StartCoroutine(MainActionSequence());
	}
예제 #5
0
	public virtual void Initialise(PlayerCharacter status, int skillIndex)
	{
		ownerStatus = status;
		ownerManager = ownerStatus.actionManager;
		ownerCAM = (CharacterActionManager)ownerStatus.actionManager;
		ownerAnimation = ownerCAM.myAnimation;
		ownerTransform = ownerStatus._myTransform;
		skillID = skillIndex;
		ownerAvatar = ownerCAM.myAvatar;
		TransferSkillAnimations();
		BasicSetup();
	}
예제 #6
0
 void Start()
 {
     controller        = GetComponent <CharacterController>();
     input             = GetComponent <InputController>();
     avatar            = GetComponent <Avatar>();
     _myTransform      = transform;
     characterVelocity = Vector3.zero;
     animationManager  = GetComponent <CharacterActionManager>();
     //rigidbodyTransform = rigidbody.transform;
     SetRotAngle(_myTransform.position + (Vector3.forward * -10f));
     SetRotTarget();
     //UpdateAnimation();
 }
예제 #7
0
    /***************/

    #region skill state

    #endregion

    #region setup and unequip
    public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
    {
        base.Initialise(target, character, actionManager, masterCollider);
        TransferAnimations();
        if (weaponCollider != null)
        {
            TriggerCollider tc = weaponCollider.GetComponent <TriggerCollider>();
            if (tc != null)
            {
                tc.ownerCollider = characterCollider;
                tc.IgnoreCollision();
            }
            weaponCollider.SetActive(false);
        }
    }
예제 #8
0
 public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     base.Initialise(target,character, actionManager, masterCollider);
     TransferAnimations();
     if(weaponCollider != null)
     {
         TriggerCollider tc = weaponCollider.GetComponent<TriggerCollider>();
         if(tc != null)
         {
             tc.ownerCollider = characterCollider;
             tc.IgnoreCollision();
         }
         weaponCollider.SetActive(false);
     }
 }
	void Awake()
	{
		if (photonView.isMine)
		{
			this.enabled = false;   // due to this, Update() is not called on the owner client.
		}
		
		latestCorrectPos = transform.position;
		onUpdatePos = transform.position;

		_transform = transform;
		_motor = GetComponent<PlayerMotor>();
		myStatus = GetComponent<CharacterStatus>();
		actionManager = GetComponent<CharacterActionManager>();
	}
예제 #10
0
	// Use this for initialization
	public override void Awake () {
		base.Awake();
		characterType = CharacterType.Playable;
		enemyCharacterType = CharacterType.AI;
		shopItems = new List<ParseInventoryItem>();
		playerActionManager = GetComponent<CharacterActionManager>();

		if(myPhotonView.isMine)
		{
			this.tag = "Player";
		}
		else
		{
			this.tag = "OtherPlayer";
			avatar.RequestInitInfo();
			RequestShopItems();
		}
	}
예제 #11
0
 public virtual void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     characterAnimation = target;
     characterTransform = character;
     characterManager = actionManager;
     characterCollider = masterCollider;
 }
예제 #12
0
    public void LoadAvatar()
    {
		//SUPER HACK
		if(NetworkManager.Instance.offlineMode || GameManager.Instance.teststate && !GameManager.Instance.newGame)
			StartNewGame();

		avatarObject = PhotonNetwork.Instantiate("PlayerAvatar", SpawnPoint.position , Quaternion.identity, 0) as GameObject;
		//avatarObject = GameObject.Instantiate(Resources.Load("PlayerAvatar"), SpawnPoint.position, Quaternion.identity) as GameObject;
		//avatarObject.AddComponent<DontDestroy>();
		avatarStatus = avatarObject.GetComponent<PlayerCharacter>();
		avatarInput = avatarObject.GetComponent<CharacterInputController>();
		avatarActionManager = avatarObject.GetComponent<CharacterActionManager>();
		//PlayerMotor cm = avatarObject.GetComponent<PlayerMotor>();
		//cm.enabled = true;
		//avatarInput.enabled = true;
		avatarNetworkMovement = avatarObject.GetComponent<NetworkCharacterMovement>();
		//UICamera.fallThrough = avatarObject;
		avatar = avatarObject.GetComponent<Avatar>();
		avatarPhotonView = avatarObject.GetComponent<PhotonView>();
		Invoke("RefreshAvatar", 0.1f);
		//PlayerCamera.Instance.targetTransform = avatarObject.transform;
		//LoadCharacterParts();
    }
예제 #13
0
 public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     base.Initialise(target,character, actionManager, masterCollider);
     TransferAnimations();
     currentAmmoCount = maxAmmoCount;
 }
예제 #14
0
 // Use this for initialization
 #region setup and unequip
 public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     base.Initialise(target, character, actionManager, masterCollider);
     TransferAnimations();
     currentAmmoCount = maxAmmoCount;
 }
예제 #15
0
	void Awake () {
        myMotor = GetComponent<PlayerMotor>();
        myActionManager = GetComponent<CharacterActionManager>();
        animationTarget = PelvisBone.GetComponent<Animation>();
        _myTransform = this.transform;
        myStatus = GetComponent<PlayerCharacter>();
		LoadBones();
	}
예제 #16
0
 public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     base.Initialise(target,character, actionManager, masterCollider);
     TransferAnimations();
     Debug.Log("override");
 }
예제 #17
0
파일: Avatar.cs 프로젝트: reaganq/mixabots
 void Awake()
 {
     characterMotor = GetComponent<CharacterMotor>();
     actionManager = GetComponent<CharacterActionManager>();
     animationTarget = PelvisBone.GetComponent<Animation>();
     _myTransform = this.transform;
 }
예제 #18
0
 void Start()
 {
     controller=GetComponent<CharacterController>();
     input = GetComponent<InputController>();
     avatar = GetComponent<Avatar>();
     _myTransform = transform;
     characterVelocity = Vector3.zero;
     animationManager = GetComponent<CharacterActionManager>();
     //rigidbodyTransform = rigidbody.transform;
     SetRotAngle(_myTransform.position+(Vector3.forward * -10f));
     SetRotTarget();
     //UpdateAnimation();
 }
예제 #19
0
    /***************/



    #region setup and unequip
    public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
    {
        base.Initialise(target, character, actionManager, masterCollider);
        TransferAnimations();
        Debug.Log("override");
    }